From 33a00fc0b1577b99ba8a3fbdab4bf1ab62dfbd8b Mon Sep 17 00:00:00 2001 From: Nate Lawson Date: Mon, 24 Oct 2005 18:34:54 +0000 Subject: [PATCH] Create the devd thread after we have called daemon(). Otherwise, it would be killed when the parent exits. Submitted by: Rudolf Cejka --- usr.sbin/powerd/powerd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/powerd/powerd.c b/usr.sbin/powerd/powerd.c index 10230a014e33..11b912f8562a 100644 --- a/usr.sbin/powerd/powerd.c +++ b/usr.sbin/powerd/powerd.c @@ -488,9 +488,6 @@ main(int argc, char * argv[]) signal(SIGTERM, handle_sigs); signal(SIGPIPE, SIG_IGN); - /* Decide whether to use ACPI or APM to read the AC line status. */ - acline_init(); - /* Run in the background unless in verbose mode. */ if (!vflag) { pid_t otherpid; @@ -512,6 +509,9 @@ main(int argc, char * argv[]) pidfile_write(pfh); } + /* Decide whether to use ACPI or APM to read the AC line status. */ + acline_init(); + /* Main loop. */ for (;;) { /* Check status every few milliseconds. */