summaryrefslogtreecommitdiff
path: root/twind.c
diff options
context:
space:
mode:
authorthe xhr <xhr@giessen.ccc.de>2021-08-26 10:45:46 +0200
committerthe xhr <xhr@giessen.ccc.de>2021-08-26 10:45:46 +0200
commitee3ef24fe50c748431c0b5c02e3bc60c0f30add4 (patch)
treee7053d12db38b3ea037217fa36e52369f998aba7 /twind.c
parent75e29febe513405dbcb534883dc76a7096a207ec (diff)
Fork child processes after daemonizing, keeps parent alive
Diffstat (limited to 'twind.c')
-rw-r--r--twind.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/twind.c b/twind.c
index bcd1393..626afb6 100644
--- a/twind.c
+++ b/twind.c
@@ -168,12 +168,13 @@ main(int argc, char *argv[])
fatalx("pledge");
#endif /* __OpenBSD__ */
- fork_main_process(tcpsock, sslctx);
if (!fg_flag)
if (daemon(0, 0) == -1)
fatalx("daemonizing failed");
+ fork_main_process(tcpsock, sslctx);
+
organize_termination();
return 0;
generated by cgit on OpenBSD