[PATCH] udev-watch: try inotify_init if inotify_init1 is not available

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



inotify_init1 first appeared in Linux 2.6.27

Signed-off-by: Steffen Sledz <sledz@xxxxxxxxxxxx>
---
 udev/udev-watch.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/udev/udev-watch.c b/udev/udev-watch.c
index f51a10d..ac679ec 100644
--- a/udev/udev-watch.c
+++ b/udev/udev-watch.c
@@ -39,6 +39,8 @@ static int inotify_fd = -1;
 int udev_watch_init(struct udev *udev)
 {
 	inotify_fd = inotify_init1(IN_CLOEXEC);
+	if (inotify_fd == -1 && errno == ENOSYS)
+		inotify_fd = inotify_init();
 	if (inotify_fd < 0)
 		err(udev, "inotify_init failed: %m\n");
 	return inotify_fd;
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux