]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
start: fix integer comparisons
authorChristian Brauner <christian.brauner@ubuntu.com>
Fri, 3 Sep 2021 09:58:55 +0000 (11:58 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Fri, 3 Sep 2021 11:01:43 +0000 (13:01 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/start.c

index 5b7be513018e82a9b7791197c2f45be09e146e73..58c4136ea6fe4d6d24926d0fa406b80f421bec6e 100644 (file)
@@ -317,7 +317,7 @@ restart:
 
 #endif
 
-               if (fd <= listen_fds_max) {
+               if ((size_t)fd <= listen_fds_max) {
                        INFO("Inheriting fd %d (using the LISTEN_FDS environment variable)", fd);
                        continue;
                }
@@ -355,7 +355,7 @@ static int setup_signal_fd(sigset_t *oldmask)
        if (ret < 0)
                return -EBADF;
 
-       for (int sig = 0; sig < (sizeof(signals) / sizeof(signals[0])); sig++) {
+       for (size_t sig = 0; sig < (sizeof(signals) / sizeof(signals[0])); sig++) {
                ret = sigdelset(&mask, signals[sig]);
                if (ret < 0)
                        return -EBADF;
@@ -446,7 +446,7 @@ static int signal_handler(int fd, uint32_t events, void *data,
        /* More robustness, protect ourself from a SIGCHLD sent
         * by a process different from the container init.
         */
-       if (siginfo.ssi_pid != hdlr->pid) {
+       if ((__u64)siginfo.ssi_pid != (__u64)hdlr->pid) {
                NOTICE("Received %d from pid %d instead of container init %d",
                       siginfo.ssi_signo, siginfo.ssi_pid, hdlr->pid);
                return hdlr->init_died ? LXC_MAINLOOP_CLOSE