summaryrefslogtreecommitdiff
path: root/udev/udev-watch.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2009-10-30 12:31:59 +0100
committerKay Sievers <kay.sievers@vrfy.org>2009-10-30 12:39:04 +0100
commit26347a4c5538008318188118872490128f43fcd3 (patch)
tree1bd46e51f23a581bc4ac0faa591a58487b015bda /udev/udev-watch.c
parent82c6558e0109f66091e3a8e2c4ceef0372b0b331 (diff)
use CLOEXEC flags instead of fcntl()
Diffstat (limited to 'udev/udev-watch.c')
-rw-r--r--udev/udev-watch.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/udev/udev-watch.c b/udev/udev-watch.c
index 102e16f81d..d67083b51b 100644
--- a/udev/udev-watch.c
+++ b/udev/udev-watch.c
@@ -38,10 +38,8 @@ static int inotify_fd = -1;
*/
int udev_watch_init(struct udev *udev)
{
- inotify_fd = inotify_init();
- if (inotify_fd >= 0)
- util_set_fd_cloexec(inotify_fd);
- else
+ inotify_fd = inotify_init1(IN_CLOEXEC);
+ if (inotify_fd < 0)
err(udev, "inotify_init failed: %m\n");
return inotify_fd;
}