| Summary: | sh cannot redirect to /dev/fd/1 or from /dev/fd/0 | ||
|---|---|---|---|
| Product: | Base System | Reporter: | marcolz <marcolz> |
| Component: | bin | Assignee: | freebsd-bugs (Nobody) <bugs> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | CC: | sys |
| Priority: | Normal | ||
| Version: | 5.0-CURRENT | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
marcolz
2001-09-01 13:40:06 UTC
It fails beacuse /dev/fd/1 is no longer connected because it is closed
on redir.c:148.
This seems to work:
--- redir.c.orig Tue Oct 3 23:13:14 2000
+++ redir.c Sat Sep 1 16:14:30 2001
@@ -143,13 +143,9 @@
break;
}
}
- if (!try) {
+ if (!try)
sv->renamed[fd] = i;
- close(fd);
- }
INTON;
- } else {
- close(fd);
}
if (fd == 0)
fd0_redirected++;
@@ -186,6 +182,7 @@
error("cannot open %s: %s", fname, errmsg(errno, E_OPEN));
movefd:
if (f != fd) {
+ close(fd);
copyfd(f, fd);
close(f);
}
Marc
State Changed From-To: open->closed Already fixed [src/bin/sh/redir.c 1.12.2.2, 1.16] |