From 273e81de7b46dc0144ef6517fbd01d408996712b Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Tue, 5 Jul 1994 23:07:53 +0000 Subject: Formerly init.c.~32~ --- init/init.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'init/init.c') 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]); -- cgit v1.2.3