From: Christian Brauner Date: Fri, 3 Sep 2021 07:51:17 +0000 (+0200) Subject: attach: fix helper declarations X-Git-Tag: lxc-5.0.0~92^2~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e5a9e11e45160c15e0f0ef2d9618900a3a88926;p=thirdparty%2Flxc.git attach: fix helper declarations Signed-off-by: Christian Brauner --- diff --git a/src/lxc/attach.c b/src/lxc/attach.c index 5668fd035..9c22931d5 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -163,7 +163,7 @@ static inline bool sync_wait_fd(int fd, int *fd_recv) return lxc_abstract_unix_recv_one_fd(fd, fd_recv, NULL, 0) > 0; } -static bool attach_lsm(lxc_attach_options_t *options) +static inline bool attach_lsm(lxc_attach_options_t *options) { return (options->attach_flags & (LXC_ATTACH_LSM | LXC_ATTACH_LSM_LABEL)); } @@ -1797,7 +1797,7 @@ int lxc_attach_run_shell(void* payload) struct passwd pwent; struct passwd *pwentp = NULL; char *user_shell; - size_t bufsize; + ssize_t bufsize; int ret; /* Ignore payload parameter. */ @@ -1806,7 +1806,7 @@ int lxc_attach_run_shell(void* payload) uid = getuid(); bufsize = sysconf(_SC_GETPW_R_SIZE_MAX); - if (bufsize == -1) + if (bufsize < 0) bufsize = 1024; buf = malloc(bufsize);