From a9d1ecb55491700a43f19b317ca375420b2c2ccd Mon Sep 17 00:00:00 2001 From: Jasper Lievisse Adriaanse Date: Thu, 21 Apr 2011 06:45:05 +0000 Subject: daemon() can fail; don't hide this for the user if that's the case. ok otto@ --- usr.sbin/apmd/apmd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'usr.sbin/apmd/apmd.c') 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)); } -- cgit v1.2.3