mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 10:08:20 +00:00
Handle failure of fcntl in Pipe. (Coverity 1241934, 1241935)
This commit is contained in:
parent
dddba3432f
commit
c009cd3289
1 changed files with 4 additions and 2 deletions
|
@ -19,13 +19,15 @@ static void pipe_fail(int eno)
|
|||
static void set_flags(int fd, int flags)
|
||||
{
|
||||
if ( flags )
|
||||
fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | flags);
|
||||
if ( fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | flags) == -1 )
|
||||
pipe_fail(errno);
|
||||
}
|
||||
|
||||
static void set_status_flags(int fd, int flags)
|
||||
{
|
||||
if ( flags )
|
||||
fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | flags);
|
||||
if ( fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | flags) == -1 )
|
||||
pipe_fail(errno);
|
||||
}
|
||||
|
||||
static int dup_or_fail(int fd, int flags)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue