From 57d2be5493cddf9a08db9c7e7c077078c3fdce2b Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Graber?= Date: Wed, 12 Feb 2014 15:39:33 -0500 Subject: [PATCH] coverity: Check return value of fcntl in lxc_popen MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber Acked-by: Serge E. Hallyn --- src/lxc/utils.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); + } } /* -- 2.47.2