From f4b2b9331eafcc84b88bb48fdec0bab4e72688a0 Mon Sep 17 00:00:00 2001 From: illiliti Date: Thu, 3 Jun 2021 09:19:45 +0300 Subject: [PATCH] udev_monitor.c: fail if monitored file is not dir --- udev_monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/udev_monitor.c b/udev_monitor.c index 17e2912..be7ec22 100644 --- a/udev_monitor.c +++ b/udev_monitor.c @@ -258,7 +258,7 @@ struct udev_monitor *udev_monitor_new_from_netlink(struct udev *udev, const char goto close_signal_fd; } - if (inotify_add_watch(udev_monitor->ifd, UDEV_MONITOR_DIR, IN_CLOSE_WRITE | IN_EXCL_UNLINK) == -1) { + if (inotify_add_watch(udev_monitor->ifd, UDEV_MONITOR_DIR, IN_CLOSE_WRITE | IN_EXCL_UNLINK | IN_ONLYDIR) == -1) { goto close_ifd; }