diff options
author | Roy Marples <roy@marples.name> | 2007-04-24 11:29:19 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2007-04-24 11:29:19 +0000 |
commit | a44abb9577a3ccb9202b84765d4b4c1746e6963d (patch) | |
tree | 9d0a3df13709385b55dc407a23d3ce94a2b52308 /src/librc-misc.c | |
parent | c965f74f46b266987ed635e65fafc9562a7ccff5 (diff) |
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.
Diffstat (limited to 'src/librc-misc.c')
-rw-r--r-- | src/librc-misc.c | 14 |
1 files changed, 14 insertions, 0 deletions
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 |