diff options
-rw-r--r-- | shell/ash.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/shell/ash.c b/shell/ash.c index 9dcf80975..8092e3971 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -5190,9 +5190,7 @@ openredirect(union node *redir) | |||
5190 | } | 5190 | } |
5191 | 5191 | ||
5192 | /* | 5192 | /* |
5193 | * Copy a file descriptor to be >= to. Returns -1 | 5193 | * Copy a file descriptor to be >= to. Throws exception on error. |
5194 | * if the source file descriptor is closed, EMPTY if there are no unused | ||
5195 | * file descriptors left. | ||
5196 | */ | 5194 | */ |
5197 | /* 0x800..00: bit to set in "to" to request dup2 instead of fcntl(F_DUPFD). | 5195 | /* 0x800..00: bit to set in "to" to request dup2 instead of fcntl(F_DUPFD). |
5198 | * old code was doing close(to) prior to copyfd() to achieve the same */ | 5196 | * old code was doing close(to) prior to copyfd() to achieve the same */ |
@@ -5213,8 +5211,6 @@ copyfd(int from, int to) | |||
5213 | newfd = fcntl(from, F_DUPFD, to); | 5211 | newfd = fcntl(from, F_DUPFD, to); |
5214 | } | 5212 | } |
5215 | if (newfd < 0) { | 5213 | if (newfd < 0) { |
5216 | if (errno == EMFILE) | ||
5217 | return EMPTY; | ||
5218 | /* Happens when source fd is not open: try "echo >&99" */ | 5214 | /* Happens when source fd is not open: try "echo >&99" */ |
5219 | ash_msg_and_raise_error("%d: %m", from); | 5215 | ash_msg_and_raise_error("%d: %m", from); |
5220 | } | 5216 | } |
@@ -10243,8 +10239,6 @@ setinputfile(const char *fname, int flags) | |||
10243 | if (fd < 10) { | 10239 | if (fd < 10) { |
10244 | fd2 = copyfd(fd, 10); | 10240 | fd2 = copyfd(fd, 10); |
10245 | close(fd); | 10241 | close(fd); |
10246 | if (fd2 < 0) | ||
10247 | ash_msg_and_raise_error("out of file descriptors"); | ||
10248 | fd = fd2; | 10242 | fd = fd2; |
10249 | } | 10243 | } |
10250 | setinputfd(fd, flags & INPUT_PUSH_FILE); | 10244 | setinputfd(fd, flags & INPUT_PUSH_FILE); |