diff options
Diffstat (limited to 'src/user/app/init/init.c')
-rw-r--r-- | src/user/app/init/init.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/user/app/init/init.c b/src/user/app/init/init.c index ca50699..fcebfc7 100644 --- a/src/user/app/init/init.c +++ b/src/user/app/init/init.c @@ -9,8 +9,13 @@ #define die(fmt, ...) do { fprintf(stderr, "init: " fmt, __VA_ARGS__); exit(1); } while (0) +static char title[128]; + void redirect(const char *exe, const char *out, const char *in) { if (!fork()) { + snprintf(title, sizeof title, "sh >%s", out); + setproctitle(title); + if (!freopen(out, "a+", stderr)) { fprintf(stdout, "couldn't open %s\n", out); exit(1); |