summaryrefslogtreecommitdiff
path: root/ufs
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1995-04-13 22:38:52 +0000
committerMiles Bader <miles@gnu.org>1995-04-13 22:38:52 +0000
commit358d5da97c37c814af4124e099fb50e2189c6d1f (patch)
treec65cac5d30ed49650456d89f1dbf0c16ce475531 /ufs
parent6a334458e5ede3990d8bee7ce391dea0c1523753 (diff)
(main): Don't abort if a std file descriptor is already open.
Diffstat (limited to 'ufs')
-rw-r--r--ufs/main.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/ufs/main.c b/ufs/main.c
index 5905cbb0..772f82ff 100644
--- a/ufs/main.c
+++ b/ufs/main.c
@@ -109,11 +109,10 @@ main (int argc, char **argv)
{
/* XXX let us see errors */
int fd = open ("/dev/console", O_RDWR);
- assert (fd == 0);
- fd = dup (0);
- assert (fd == 1);
- fd = dup (1);
- assert (fd == 2);
+ while (fd >= 0 && fd < 2)
+ fd = dup(fd);
+ if (fd > 2)
+ close (fd);
}
}
else