diff options
author | imp <imp@FreeBSD.org> | 2003-07-05 00:43:50 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2003-07-05 00:43:50 +0000 |
commit | b29651d73e8ca9350720a87c29f7d0c6c7cdf943 (patch) | |
tree | 2abdfcda96bde0a2a7d0d224365c9488127a2b98 | |
parent | 705cd167e6e240e5a360ca12e297d74e1d49c04d (diff) | |
download | FreeBSD-src-b29651d73e8ca9350720a87c29f7d0c6c7cdf943.zip FreeBSD-src-b29651d73e8ca9350720a87c29f7d0c6c7cdf943.tar.gz |
Drop the pid file after we call the final daemon call. w/o -n would
give the wrong pid.
Submitted by: ru and Lukas Ertl
PR: 54113
-rw-r--r-- | sbin/devd/devd.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sbin/devd/devd.cc b/sbin/devd/devd.cc index 2fa9132..288e90a 100644 --- a/sbin/devd/devd.cc +++ b/sbin/devd/devd.cc @@ -596,6 +596,7 @@ event_loop(void) if (Dflag) fprintf(stderr, "Calling daemon\n"); daemon(0, 0); + cfg.drop_pidfile(); once++; } } @@ -743,9 +744,10 @@ main(int argc, char **argv) } cfg.parse(); - if (!dflag && nflag) + if (!dflag && nflag) { daemon(0, 0); - cfg.drop_pidfile(); + cfg.drop_pidfile(); + } signal(SIGHUP, gensighand); signal(SIGINT, gensighand); signal(SIGTERM, gensighand); |