Commit 6ef5d068 authored by Bruno Haible's avatar Bruno Haible
Browse files

Fix test of fcntl's return value.

parent 802f6fc3
2009-08-23 Bruno Haible <bruno@clisp.org>
* lib/pipe2.c (pipe2): Fix test of fcntl's return value.
2009-08-23 Bruno Haible <bruno@clisp.org>
 
* modules/fchdir (Depends-on): Use fcntl-h instead of fcntl.
......@@ -70,9 +70,9 @@ pipe2 (int fd[2], int flags)
int fcntl_flags;
if ((fcntl_flags = fcntl (fd[1], F_GETFL, 0)) < 0
|| fcntl (fd[1], F_SETFL, fcntl_flags | O_NONBLOCK) < 0
|| fcntl (fd[1], F_SETFL, fcntl_flags | O_NONBLOCK) == -1
|| (fcntl_flags = fcntl (fd[0], F_GETFL, 0)) < 0
|| fcntl (fd[0], F_SETFL, fcntl_flags | O_NONBLOCK) < 0)
|| fcntl (fd[0], F_SETFL, fcntl_flags | O_NONBLOCK) == -1)
goto fail;
}
......@@ -81,9 +81,9 @@ pipe2 (int fd[2], int flags)
int fcntl_flags;
if ((fcntl_flags = fcntl (fd[1], F_GETFD, 0)) < 0
|| fcntl (fd[1], F_SETFD, fcntl_flags | FD_CLOEXEC) < 0
|| fcntl (fd[1], F_SETFD, fcntl_flags | FD_CLOEXEC) == -1
|| (fcntl_flags = fcntl (fd[0], F_GETFD, 0)) < 0
|| fcntl (fd[0], F_SETFD, fcntl_flags | FD_CLOEXEC) < 0)
|| fcntl (fd[0], F_SETFD, fcntl_flags | FD_CLOEXEC) == -1)
goto fail;
}
......
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