diff options
-rw-r--r-- | daemons/console-run.c | 1 | ||||
-rw-r--r-- | exec/main.c | 1 | ||||
-rw-r--r-- | libdiskfs/console.c | 1 | ||||
-rw-r--r-- | libmachdev/trivfs_server.c | 1 | ||||
-rw-r--r-- | mach-defpager/main.c | 2 | ||||
-rw-r--r-- | proc/main.c | 2 | ||||
-rw-r--r-- | startup/startup.c | 2 | ||||
-rw-r--r-- | utils/shd.c | 1 |
8 files changed, 8 insertions, 3 deletions
diff --git a/daemons/console-run.c b/daemons/console-run.c index f98ebf8a..eab1f51d 100644 --- a/daemons/console-run.c +++ b/daemons/console-run.c @@ -59,6 +59,7 @@ main (int argc, char **argv) stderr = mach_open_devstream (consdev, "w"); if (!stderr) _exit (127); + setlinebuf (stderr); if (argc < 2) error (1, 0, "Usage: %s PROGRAM [ARG...]", program_invocation_short_name); diff --git a/exec/main.c b/exec/main.c index 9021e45c..57bfd137 100644 --- a/exec/main.c +++ b/exec/main.c @@ -187,6 +187,7 @@ open_console (mach_port_t device_master) stdin = mach_open_devstream (cons, "r"); stdout = stderr = mach_open_devstream (cons, "w"); + setlinebuf (stderr); got_console = 1; mach_port_deallocate (mach_task_self (), cons); diff --git a/libdiskfs/console.c b/libdiskfs/console.c index cd93f025..9bf7cd2d 100644 --- a/libdiskfs/console.c +++ b/libdiskfs/console.c @@ -76,6 +76,7 @@ diskfs_console_stdio (void) stdin = mach_open_devstream (cons, "r"); stdout = stderr = mach_open_devstream (cons, "w"); mach_port_deallocate (mach_task_self (), cons); + setlinebuf (stderr); } /* And make sure we don't die just because we got some error there. */ diff --git a/libmachdev/trivfs_server.c b/libmachdev/trivfs_server.c index 4ce1ed36..e228bf40 100644 --- a/libmachdev/trivfs_server.c +++ b/libmachdev/trivfs_server.c @@ -399,6 +399,7 @@ resume_bootstrap_server(mach_port_t server_task, const char *server_name) stdin = mach_open_devstream (cons, "r"); stdout = stderr = mach_open_devstream (cons, "w"); mach_port_deallocate (mach_task_self (), cons); + setlinebuf (stderr); printf ("%s ", server_name); fflush (stdout); diff --git a/mach-defpager/main.c b/mach-defpager/main.c index 8fbe2adc..27865eea 100644 --- a/mach-defpager/main.c +++ b/mach-defpager/main.c @@ -69,7 +69,7 @@ printf_init (device_t master) stdin = mach_open_devstream (cons, "r"); stdout = stderr = mach_open_devstream (cons, "w"); mach_port_deallocate (mach_task_self (), cons); - setbuf (stdout, 0); + setlinebuf (stderr); } diff --git a/proc/main.c b/proc/main.c index 747646ef..56ba3d3d 100644 --- a/proc/main.c +++ b/proc/main.c @@ -132,7 +132,7 @@ open_console (mach_port_t device_master) stdin = mach_open_devstream (cons, "r"); stdout = stderr = mach_open_devstream (cons, "w"); - setbuf (stdout, NULL); + setlinebuf (stderr); got_console = 1; mach_port_deallocate (mach_task_self (), cons); diff --git a/startup/startup.c b/startup/startup.c index 5666efc6..34186986 100644 --- a/startup/startup.c +++ b/startup/startup.c @@ -770,7 +770,7 @@ main (int argc, char **argv, char **envp) stdin = mach_open_devstream (consdev, "r"); if (stdout == NULL || stdin == NULL) crash_mach (); - setbuf (stdout, NULL); + setlinebuf (stderr); err = wire_task_self (); if (err) diff --git a/utils/shd.c b/utils/shd.c index d2075075..9683f216 100644 --- a/utils/shd.c +++ b/utils/shd.c @@ -249,6 +249,7 @@ main (int argc, char *argv[]) stdin = mach_open_devstream (outp, "r"); stdout = stderr = mach_open_devstream (outp, "w+"); + setlinebuf (stderr); } #endif |