summaryrefslogtreecommitdiff
path: root/lib/pipe-safer.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2009-12-11 15:28:11 +0100
committerBruno Haible <bruno@clisp.org>2009-12-11 15:28:11 +0100
commit791d74af1a192210138c61c7a85855da071f8654 (patch)
treec61d278f09b2ae6f14c84094be099d225268f64f /lib/pipe-safer.c
parentd4294edebdaa6e2be0fca254afacd42d074881bb (diff)
downloadgnulib-791d74af1a192210138c61c7a85855da071f8654.tar.gz
Move pipe2-safer code to its own file.
Diffstat (limited to 'lib/pipe-safer.c')
-rw-r--r--lib/pipe-safer.c28
1 files changed, 0 insertions, 28 deletions
diff --git a/lib/pipe-safer.c b/lib/pipe-safer.c
index fda5c52875..2d5167988e 100644
--- a/lib/pipe-safer.c
+++ b/lib/pipe-safer.c
@@ -54,31 +54,3 @@ pipe_safer (int fd[2])
return -1;
}
-
-#if GNULIB_PIPE2_SAFER
-/* Like pipe2, but ensure that neither of the file descriptors is
- STDIN_FILENO, STDOUT_FILENO, or STDERR_FILENO. */
-
-int
-pipe2_safer (int fd[2], int flags)
-{
- if (pipe2 (fd, flags) == 0)
- {
- int i;
- for (i = 0; i < 2; i++)
- {
- fd[i] = fd_safer_flag (fd[i], flags);
- if (fd[i] < 0)
- {
- int e = errno;
- close (fd[1 - i]);
- errno = e;
- return -1;
- }
- }
-
- return 0;
- }
- return -1;
-}
-#endif /* GNULIB_PIPE2 */