diff options
author | Florian Weimer <fweimer@redhat.com> | 2017-04-18 14:09:01 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2017-04-18 14:09:01 +0200 |
commit | 46d8874d5b2fcb7831dd84c5e2f6df51922a7936 (patch) | |
tree | 298787303d12ee07ef36fb95033467feed045211 /posix | |
parent | 025b33ae84bb8f15b2748a1d8605dca453fce112 (diff) | |
download | glibc-46d8874d5b2fcb7831dd84c5e2f6df51922a7936.tar.gz glibc-46d8874d5b2fcb7831dd84c5e2f6df51922a7936.tar.xz glibc-46d8874d5b2fcb7831dd84c5e2f6df51922a7936.zip |
Assume that pipe2 is always available
The Debian patches for Hurd (which are already required to build glibc before this commit) contain an implementation of pipe2.
Diffstat (limited to 'posix')
-rw-r--r-- | posix/wordexp.c | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/posix/wordexp.c b/posix/wordexp.c index ba3f3ed4b6..8567c9fc50 100644 --- a/posix/wordexp.c +++ b/posix/wordexp.c @@ -836,10 +836,7 @@ exec_comm_child (char *comm, int *fildes, int showerr, int noexec) { #ifdef O_CLOEXEC /* Reset the close-on-exec flag (if necessary). */ -# ifndef __ASSUME_PIPE2 - if (__have_pipe2 > 0) -# endif - __fcntl (fildes[1], F_SETFD, 0); + __fcntl (fildes[1], F_SETFD, 0); #endif } @@ -905,31 +902,8 @@ exec_comm (char *comm, char **word, size_t *word_length, size_t *max_length, if (!comm || !*comm) return 0; -#ifdef O_CLOEXEC -# ifndef __ASSUME_PIPE2 - if (__have_pipe2 >= 0) -# endif - { - int r = __pipe2 (fildes, O_CLOEXEC); -# ifndef __ASSUME_PIPE2 - if (__have_pipe2 == 0) - __have_pipe2 = r != -1 || errno != ENOSYS ? 1 : -1; - - if (__have_pipe2 > 0) -# endif - if (r < 0) - /* Bad */ - return WRDE_NOSPACE; - } -#endif -#ifndef __ASSUME_PIPE2 -# ifdef O_CLOEXEC - if (__have_pipe2 < 0) -# endif - if (__pipe (fildes) < 0) - /* Bad */ - return WRDE_NOSPACE; -#endif + if (__pipe2 (fildes, O_CLOEXEC) < 0) + return WRDE_NOSPACE; again: if ((pid = __fork ()) < 0) |