]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
monitor.c: sanity check on waitpid return value
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 25 Apr 2013 00:59:10 +0000 (19:59 -0500)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 25 Apr 2013 00:59:10 +0000 (19:59 -0500)
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/monitor.c

index 0521e9ab3e4009598edf7ed839642ec5536e8289..5d655bd1a44b6b867ec6e0eb9ead4cdcd01c198d 100644 (file)
@@ -207,7 +207,8 @@ int lxc_monitord_spawn(const char *lxcpath)
        }
 
        if (pid1) {
-               waitpid(pid1, NULL, 0);
+               if (waitpid(pid1, NULL, 0) != pid1)
+                       SYSERROR("unexpected waitpid return value on double-fork");
                return 0;
        }