summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2008-11-22 22:22:06 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2008-11-22 22:22:06 +0000
commitfc8a6a3ac7bedafc0d2baf2008b0773118c010c7 (patch)
tree9bcc962c712a64373ed0a2eb14cf7ea8fa19769d /usr.sbin
parent5c0fec0066b99dfbda64cd0d0f710db110a7b3cb (diff)
- do not set nochdir in daemon() call, we want parent and lka to have their
wd reset to / rather than current working directory. From Jacek Masiulaniec <jacekm@dobremiasto.net>
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/smtpd/smtpd.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.sbin/smtpd/smtpd.c b/usr.sbin/smtpd/smtpd.c
index 2bbd72ba0bc..335bb1e2ac7 100644
--- a/usr.sbin/smtpd/smtpd.c
+++ b/usr.sbin/smtpd/smtpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtpd.c,v 1.10 2008/11/17 20:37:48 gilles Exp $ */
+/* $OpenBSD: smtpd.c,v 1.11 2008/11/22 22:22:05 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -554,10 +554,9 @@ main(int argc, char *argv[])
log_init(debug);
- if (!debug) {
- if (daemon(1, 0) == -1)
+ if (!debug)
+ if (daemon(0, 0) == -1)
err(1, "failed to daemonize");
- }
log_info("startup%s", (debug > 1)?" [debug mode]":"");