aboutsummaryrefslogtreecommitdiff
path: root/gmid.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-01-17 11:56:50 +0000
committerOmar Polo <op@omarpolo.com>2021-01-17 11:56:50 +0000
commit0170ba023f9c85bde2c4ae410b0af741383b7317 (patch)
tree0d069e73e99a7e214f7707afa03a906efd1008bd /gmid.c
parentb3927be446193f54dde95d62852ce6757c75189b (diff)
re-enable daemon mode
with the split into two process, the call to daemon was lost
Diffstat (limited to 'gmid.c')
-rw-r--r--gmid.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gmid.c b/gmid.c
index ec6ec68..bb1254b 100644
--- a/gmid.c
+++ b/gmid.c
@@ -876,8 +876,11 @@ main(int argc, char **argv)
#endif
signal(SIGUSR2, sig_handler);
- if (!conf.foreground)
+ if (!conf.foreground) {
signal(SIGHUP, SIG_IGN);
+ if (daemon(1, 1) == -1)
+ err(1, "daemon");
+ }
if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, p) == -1)
fatal("socketpair: %s", strerror(errno));