diff options
author | Miles Bader <miles@gnu.org> | 1995-04-13 22:38:52 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1995-04-13 22:38:52 +0000 |
commit | 5d0490f7a88ac00a1f1d44e400cf9a7106168222 (patch) | |
tree | 841c2ec06a291c5c19c8f82b064c2d8a0993d044 | |
parent | aea32c3dbee4480afc60295b10252faec4eebd47 (diff) |
(main): Don't abort if a std file descriptor is already open.
-rw-r--r-- | ufs/main.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -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 |