aboutsummaryrefslogtreecommitdiff
path: root/src/libthread/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libthread/thread.c')
-rw-r--r--src/libthread/thread.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libthread/thread.c b/src/libthread/thread.c
index 92e93940..84e21717 100644
--- a/src/libthread/thread.c
+++ b/src/libthread/thread.c
@@ -476,6 +476,8 @@ main(int argc, char **argv)
{
Proc *p;
+ argv0 = argv[0];
+
_threadsetupdaemonize();
threadargc = argc;
@@ -503,7 +505,8 @@ main(int argc, char **argv)
mainstacksize = 65536;
_threadcreate(p, threadmainstart, nil, mainstacksize);
scheduler(p);
- return 0; /* not reached */
+ threaddaemonize();
+ _threadpexit();
}
/*