diff options
author | Gilles Chehade <gilles@cvs.openbsd.org> | 2008-11-22 22:22:06 +0000 |
---|---|---|
committer | Gilles Chehade <gilles@cvs.openbsd.org> | 2008-11-22 22:22:06 +0000 |
commit | fc8a6a3ac7bedafc0d2baf2008b0773118c010c7 (patch) | |
tree | 9bcc962c712a64373ed0a2eb14cf7ea8fa19769d /usr.sbin/smtpd | |
parent | 5c0fec0066b99dfbda64cd0d0f710db110a7b3cb (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/smtpd')
-rw-r--r-- | usr.sbin/smtpd/smtpd.c | 7 |
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]":""); |