summaryrefslogtreecommitdiffstats
path: root/src/libthread/daemonize.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libthread/daemonize.c')
-rw-r--r--src/libthread/daemonize.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libthread/daemonize.c b/src/libthread/daemonize.c
index 387d1527..f994ffe1 100644
--- a/src/libthread/daemonize.c
+++ b/src/libthread/daemonize.c
@@ -8,7 +8,7 @@
#undef wait
static int sigpid;
-static int threadpassfd;
+static int threadpassfd = -1;
static int gotsigchld;
static void
@@ -163,9 +163,9 @@ _threadsetupdaemonize(void)
void
_threaddaemonize(void)
{
- if(threadpassfd >= 0){
- write(threadpassfd, "0", 1);
- close(threadpassfd);
- threadpassfd = -1;
- }
+ if(threadpassfd < 0)
+ sysfatal("threads in main proc exited w/o threadmaybackground");
+ write(threadpassfd, "0", 1);
+ close(threadpassfd);
+ threadpassfd = -1;
}