summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2019-01-20 02:42:24 +0000
committerkrw <krw@openbsd.org>2019-01-20 02:42:24 +0000
commitb953f70ec706d67b78a400bed5826fdcc6546e6d (patch)
tree067689454c9a2c0bc5555fef5da21cd0f6162cf2
parentAdd an explicit flag to indicate a successful handshake instead (diff)
downloadwireguard-openbsd-b953f70ec706d67b78a400bed5826fdcc6546e6d.tar.xz
wireguard-openbsd-b953f70ec706d67b78a400bed5826fdcc6546e6d.zip
Don't delay signal(SIGPIPE, SIG_IGN) until go_daemon() does it. First,
go_daemon() may not be called before the first error. Second, go_daemon() doesn't do anything when '-d' is specified.
-rw-r--r--sbin/dhclient/dhclient.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index 4904c82661f..e19ca2a922c 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhclient.c,v 1.618 2019/01/19 21:23:18 krw Exp $ */
+/* $OpenBSD: dhclient.c,v 1.619 2019/01/20 02:42:24 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -551,6 +551,8 @@ main(int argc, char *argv[])
exit(0);
}
+ signal(SIGPIPE, SIG_IGN); /* Don't wait for go_daemon()! */
+
if (socketpair(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK | SOCK_CLOEXEC, 0,
socket_fd) == -1)
fatal("socketpair");