coverity: Check return value of fcntl in lxc_popen

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
Stéphane Graber 2014-02-12 15:39:33 -05:00
parent e7de366c67
commit 57d2be5493

View 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);
}
}
/*