summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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