diff options
author | dzwdz | 2023-08-10 00:23:45 +0200 |
---|---|---|
committer | dzwdz | 2023-08-10 00:23:45 +0200 |
commit | 116c5c2c47998b62fc7e352864735945dc14ca3f (patch) | |
tree | 31b0c194d40f91c18ca2bed4e96f2835c18e549e /src/user/app/init | |
parent | fe2767219e22eda853cb1ad30c44c49afc1bed66 (diff) |
user: more descriptive process titles
Diffstat (limited to 'src/user/app/init')
-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); |