From: Stéphane Graber Date: Wed, 12 Feb 2014 20:39:33 +0000 (-0500) Subject: coverity: Check return value of fcntl in lxc_popen X-Git-Tag: lxc-1.0.0.rc1~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=57d2be5493cddf9a08db9c7e7c077078c3fdce2b;p=thirdparty%2Flxc.git coverity: Check return value of fcntl in lxc_popen Signed-off-by: Stéphane Graber Acked-by: Serge E. Hallyn --- diff --git a/src/lxc/utils.c b/src/lxc/utils.c index b7a29cb39..90401a580 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -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); + } } /*