diff options
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ash.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/shell/ash.c b/shell/ash.c index a0c22689f..007d501f9 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -3715,7 +3715,7 @@ setjobctl(int on) | |||
3715 | if (--fd < 0) | 3715 | if (--fd < 0) |
3716 | goto out; | 3716 | goto out; |
3717 | } | 3717 | } |
3718 | fd = fcntl(fd, F_DUPFD, 10); | 3718 | fd = copyfd(fd, 10); |
3719 | if (ofd >= 0) | 3719 | if (ofd >= 0) |
3720 | close(ofd); | 3720 | close(ofd); |
3721 | if (fd < 0) | 3721 | if (fd < 0) |
@@ -5270,7 +5270,7 @@ redirect(union node *redir, int flags) | |||
5270 | #endif | 5270 | #endif |
5271 | if (need_to_remember(sv, fd)) { | 5271 | if (need_to_remember(sv, fd)) { |
5272 | /* Copy old descriptor */ | 5272 | /* Copy old descriptor */ |
5273 | i = fcntl(fd, F_DUPFD, 10); | 5273 | i = copyfd(fd, 10); |
5274 | /* You'd expect copy to be CLOEXECed. Currently these extra "saved" fds | 5274 | /* You'd expect copy to be CLOEXECed. Currently these extra "saved" fds |
5275 | * are closed in popredir() in the child, preventing them from leaking | 5275 | * are closed in popredir() in the child, preventing them from leaking |
5276 | * into child. (popredir() also cleans up the mess in case of failures) | 5276 | * into child. (popredir() also cleans up the mess in case of failures) |