]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
coverity: Check return value of fcntl in lxc_popen
authorStéphane Graber <stgraber@ubuntu.com>
Wed, 12 Feb 2014 20:39:33 +0000 (15:39 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 12 Feb 2014 22:03:01 +0000 (17:03 -0500)
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/utils.c

index b7a29cb3955c7f0182ecde7ca8b5cb886a109891..90401a58018a1ba4d7dc73fe2e34b322db9b0ffb 100644 (file)
@@ -642,7 +642,10 @@ extern struct lxc_popen_FILE *lxc_popen(const char *command)
                         * But it must not be marked close-on-exec.
                         * Undo the effects.
                         */
-                       fcntl(child_end, F_SETFD, 0);
+                       if (fcntl(child_end, F_SETFD, 0) != 0) {
+                               SYSERROR("Failed to remove FD_CLOEXEC from fd.");
+                               exit(127);
+                       }
                }
 
                /*