From a44abb9577a3ccb9202b84765d4b4c1746e6963d Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Tue, 24 Apr 2007 11:29:19 +0000 Subject: We now buffer stdout and stderr to a file and flush that when running in parallel. RC_PARALLEL_STARTUP has been renamed to RC_PARALLEL. --- src/librc-misc.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/librc-misc.c') diff --git a/src/librc-misc.c b/src/librc-misc.c index 0700863e..a2b38b4a 100644 --- a/src/librc-misc.c +++ b/src/librc-misc.c @@ -644,6 +644,20 @@ char **rc_config_env (char **env) } else env = rc_strlist_add (env, "RC_DEFAULTLEVEL=" RC_LEVEL_DEFAULT); + /* Store the name of the tty that stdout is connected to + * We do this so our init scripts can call eflush without any knowledge + * of our fd's */ + if (isatty (fileno (stdout))) { + if ((p = rc_xstrdup (ttyname (fileno (stdout))))) { + i = strlen ("RC_TTY=") + strlen (p) + 1; + line = rc_xmalloc (sizeof (char *) * i); + snprintf (line, i, "RC_TTY=%s", p); + env = rc_strlist_add (env, line); + free (p); + free (line); + } + } + memset (sys, 0, sizeof (sys)); /* Linux can run some funky stuff like Xen, VServer, UML, etc -- cgit v1.2.3