| Summary: | Re: sh cannot redirect to /dev/fd/1 or from /dev/fd/0 | ||
|---|---|---|---|
| Product: | Base System | Reporter: | marcolz <marcolz> |
| Component: | bin | Assignee: | GNATS administrator <gnats-admin> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | CC: | sys |
| Priority: | Normal | ||
| Version: | 1.0-RELEASE | ||
| Hardware: | Any | ||
| OS: | Any | ||
State Changed From-To: open->closed Not a new PR. |
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