From 71b2940d87135239762951024557e51a58b8224b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Fri, 14 Feb 2014 16:07:41 -0500 Subject: [PATCH] coverity: Check fcntl return value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber Acked-by: Serge E. Hallyn --- src/lxc/attach.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lxc/attach.c b/src/lxc/attach.c index 28cf91635..a59dae330 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -1026,8 +1026,11 @@ static int attach_child_main(void* data) flags = fcntl(fd, F_GETFL); if (flags < 0) continue; - if (flags & FD_CLOEXEC) - fcntl(fd, F_SETFL, flags & ~FD_CLOEXEC); + if (flags & FD_CLOEXEC) { + if (fcntl(fd, F_SETFL, flags & ~FD_CLOEXEC) < 0) { + SYSERROR("Unable to clear CLOEXEC from fd"); + } + } } /* we're done, so we can now do whatever the user intended us to do */