diff options
author | Michael I. Bushnell <mib@gnu.org> | 1994-07-05 23:07:53 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1994-07-05 23:07:53 +0000 |
commit | 273e81de7b46dc0144ef6517fbd01d408996712b (patch) | |
tree | 2919c6fa46ab6e16d1450a0654ddef071fa4aa5a | |
parent | 543b5c774e2e57ad232a72175436b342de6c881a (diff) |
Formerly init.c.~32~
-rw-r--r-- | init/init.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/init/init.c b/init/init.c index 54153f5d..8ac3d316 100644 --- a/init/init.c +++ b/init/init.c @@ -367,10 +367,10 @@ main (int argc, char **argv, char **envp) || device_open (device_master, D_WRITE, "console", &consdev)) crash_mach (); - stdin = mach_open_devstream (consdev, "w+"); - if (stdin == NULL) + stderr = stdout = mach_open_devstream (consdev, "w"); + stdin = mach_open_devstream (consdev, "r"); + if (stdout == NULL || stdin == NULL) crash_mach (); - stdout = stderr = stdin; setbuf (stdout, NULL); /* At this point we can use assert to check for errors. */ @@ -494,6 +494,9 @@ launch_system (void) dup2 (fd, 2); close (fd); + fclose (stdin); + stdin = fdopen (0, "r"); + /* Set ports in init_dtable for programs we start */ mach_port_deallocate (mach_task_self (), default_dtable[0]); mach_port_deallocate (mach_task_self (), default_dtable[1]); |