diff options
author | Jasper Lievisse Adriaanse <jasper@cvs.openbsd.org> | 2011-04-21 06:45:05 +0000 |
---|---|---|
committer | Jasper Lievisse Adriaanse <jasper@cvs.openbsd.org> | 2011-04-21 06:45:05 +0000 |
commit | a9d1ecb55491700a43f19b317ca375420b2c2ccd (patch) | |
tree | 3af7935909f7c2f542edcb72f14930edd795cd83 /usr.sbin/apmd/apmd.c | |
parent | e98d69b14dd08856abde29fb967f9eb1c845bb3a (diff) |
daemon() can fail; don't hide this for the user if that's the case.
ok otto@
Diffstat (limited to 'usr.sbin/apmd/apmd.c')
-rw-r--r-- | usr.sbin/apmd/apmd.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/apmd/apmd.c b/usr.sbin/apmd/apmd.c index 0435a1c89fe..5a65d9702c7 100644 --- a/usr.sbin/apmd/apmd.c +++ b/usr.sbin/apmd/apmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apmd.c,v 1.56 2010/04/02 04:12:46 deraadt Exp $ */ +/* $OpenBSD: apmd.c,v 1.57 2011/04/21 06:45:04 jasper Exp $ */ /* * Copyright (c) 1995, 1996 John T. Kohl @@ -568,7 +568,8 @@ main(int argc, char *argv[]) if (debug) openlog(__progname, LOG_CONS, LOG_LOCAL1); else { - daemon(0, 0); + if (daemon(0, 0) < 0) + error("failed to daemonize", NULL); openlog(__progname, LOG_CONS, LOG_DAEMON); setlogmask(LOG_UPTO(LOG_NOTICE)); } |