Commit 71b2940d by Stéphane Graber

coverity: Check fcntl return value

parent acd4922e
......@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment