From: Christian Brauner Date: Fri, 3 Sep 2021 10:54:57 +0000 (+0200) Subject: monitor: fix integer comparisons X-Git-Tag: lxc-5.0.0~92^2~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d535a483c90373b3395e0eee0fa15b5bb8182cbb;p=thirdparty%2Flxc.git monitor: fix integer comparisons Signed-off-by: Christian Brauner --- diff --git a/src/lxc/monitor.c b/src/lxc/monitor.c index 1c1d7039a..b01355168 100644 --- a/src/lxc/monitor.c +++ b/src/lxc/monitor.c @@ -224,7 +224,6 @@ int lxc_monitor_open(const char *lxcpath) int lxc_monitor_read_fdset(struct pollfd *fds, nfds_t nfds, struct lxc_msg *msg, int timeout) { - long i; int ret; ret = poll(fds, nfds, timeout * 1000); @@ -236,7 +235,7 @@ int lxc_monitor_read_fdset(struct pollfd *fds, nfds_t nfds, struct lxc_msg *msg, /* Only read from the first ready fd, the others will remain ready for * when this routine is called again. */ - for (i = 0; i < nfds; i++) { + for (size_t i = 0; i < nfds; i++) { if (fds[i].revents != 0) { fds[i].revents = 0; ret = recv(fds[i].fd, msg, sizeof(*msg), 0); @@ -327,8 +326,9 @@ int lxc_monitord_spawn(const char *lxcpath) * synced with the child process. the if-empty-statement * construct is to quiet the warn-unused-result warning. */ - if (lxc_read_nointr(pipefd[0], &c, 1)) + if (lxc_read_nointr(pipefd[0], &c, 1)) { ; + } close(pipefd[0]);