summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/user/app/init/init.c5
-rw-r--r--src/user/app/netstack/netstack.c1
2 files changed, 6 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);
diff --git a/src/user/app/netstack/netstack.c b/src/user/app/netstack/netstack.c
index 55b716a..2636429 100644
--- a/src/user/app/netstack/netstack.c
+++ b/src/user/app/netstack/netstack.c
@@ -44,6 +44,7 @@ int main(int argc, char **argv) {
eprintf("invalid gateway");
return -1;
}
+ setproctitle(argv[2]);
arp_request(state.gateway);
thread_create(0, network_thread, NULL);
thread_create(0, fs_thread, NULL);