aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-04-14 00:36:22 +0200
committerNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-04-20 19:14:40 +0200
commit377e7c3417a1a46035efd9aeb9875070ea452f5c (patch)
tree51047ff678f135c37a72fed10c3de76ce2254946 /shell
parent09143ee49a2f51596adad443b394e9bd5a98ecf1 (diff)
downloadbusybox-w32-377e7c3417a1a46035efd9aeb9875070ea452f5c.tar.gz
busybox-w32-377e7c3417a1a46035efd9aeb9875070ea452f5c.tar.bz2
busybox-w32-377e7c3417a1a46035efd9aeb9875070ea452f5c.zip
win32: ash: stay away from fcntl(F_DUPFD)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c4
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)