diff options
author | Martin Natano <natano@cvs.openbsd.org> | 2016-07-31 20:13:13 +0000 |
---|---|---|
committer | Martin Natano <natano@cvs.openbsd.org> | 2016-07-31 20:13:13 +0000 |
commit | af6f58e72e9b22822b99191a2665205e89f333f9 (patch) | |
tree | bc902985add86227a0dd37429da1f7aec4054b32 /usr.sbin | |
parent | e122590a9432383ca074a3be1a4e2ec339340fdf (diff) |
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')
-rw-r--r-- | usr.sbin/hotplugd/hotplugd.c | 4 |
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)); |