summaryrefslogtreecommitdiff
path: root/udev/udev-watch.c
diff options
context:
space:
mode:
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;
}