Skip to content

Commit

Permalink
coverity: Check fcntl return value
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
  • Loading branch information
stgraber committed Feb 15, 2014
1 parent acd4922 commit 71b2940
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/lxc/attach.c
Expand Up @@ -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 */
Expand Down

0 comments on commit 71b2940

Please sign in to comment.