summaryrefslogtreecommitdiffstats
path: root/usr.sbin/apmd
diff options
context:
space:
mode:
authorjasper <jasper@openbsd.org>2011-04-21 06:45:04 +0000
committerjasper <jasper@openbsd.org>2011-04-21 06:45:04 +0000
commit4dbc74fc65e49834e38328511e5538c035e2c8dd (patch)
tree7169c453b3a976e5fa1338e3adba8feb7f909af0 /usr.sbin/apmd
parentRevert the ``remove the `skip splraise/splx for IPL_NONE mutexes' optimization'' (diff)
downloadwireguard-openbsd-4dbc74fc65e49834e38328511e5538c035e2c8dd.tar.xz
wireguard-openbsd-4dbc74fc65e49834e38328511e5538c035e2c8dd.zip
daemon() can fail; don't hide this for the user if that's the case.
ok otto@
Diffstat (limited to 'usr.sbin/apmd')
-rw-r--r--usr.sbin/apmd/apmd.c5
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));
}