summaryrefslogtreecommitdiffstats
path: root/usr.sbin/hotplugd
diff options
context:
space:
mode:
authornatano <natano@openbsd.org>2016-07-31 20:13:12 +0000
committernatano <natano@openbsd.org>2016-07-31 20:13:12 +0000
commit90365ab5630e3747aa06b2a318b8ac39f92bc329 (patch)
tree4529806de902d33cfa9664461919c69857e09317 /usr.sbin/hotplugd
parentbump for LibreSSL 2.5.x (diff)
downloadwireguard-openbsd-90365ab5630e3747aa06b2a318b8ac39f92bc329.tar.xz
wireguard-openbsd-90365ab5630e3747aa06b2a318b8ac39f92bc329.zip
Close /dev/hotplug on exec(). Otherwise a restart of the daemon may
fail, because the device is occupied by a child process. from Alexey Vatchenko ok jca
Diffstat (limited to 'usr.sbin/hotplugd')
-rw-r--r--usr.sbin/hotplugd/hotplugd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/hotplugd/hotplugd.c b/usr.sbin/hotplugd/hotplugd.c
index 2e23bc7c19e..1b067b6ea33 100644
--- a/usr.sbin/hotplugd/hotplugd.c
+++ b/usr.sbin/hotplugd/hotplugd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hotplugd.c,v 1.13 2015/11/19 06:05:40 deraadt Exp $ */
+/* $OpenBSD: hotplugd.c,v 1.14 2016/07/31 20:13:12 natano Exp $ */
/*
* Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org>
*
@@ -80,7 +80,7 @@ main(int argc, char *argv[])
if (argc > 0)
usage();
- if ((devfd = open(device, O_RDONLY)) == -1)
+ if ((devfd = open(device, O_RDONLY | O_CLOEXEC)) == -1)
err(1, "%s", device);
bzero(&sact, sizeof(sact));