chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use CLOEXEC flags instead of fcntl()
[elogind.git]
/
udev
/
udev-watch.c
diff --git
a/udev/udev-watch.c
b/udev/udev-watch.c
index 102e16f81d0fbfc21a7310024ac5e4e8d6461be0..d67083b51b3a67e3d14f9d2a7b6b4ef5113646a2 100644
(file)
--- 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)
{
*/
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;
}
err(udev, "inotify_init failed: %m\n");
return inotify_fd;
}