X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=udev%2Fudev-watch.c;h=5a49c963da82a0651aa50c7612580419abc063c6;hb=1e03b754aef576a5cb75f01b1805cdc1f9cc292f;hp=53492e5f357fd2fcb73128af2a95721fd55bd99b;hpb=e6c1a2bde7609cc703a5fad34c3bc1d15d19bbdc;p=elogind.git diff --git a/udev/udev-watch.c b/udev/udev-watch.c index 53492e5f3..5a49c963d 100644 --- a/udev/udev-watch.c +++ b/udev/udev-watch.c @@ -26,27 +26,24 @@ #include #include #include -#ifdef HAVE_INOTIFY #include -#endif #include "udev.h" -int inotify_fd = -1; +static int inotify_fd = -1; /* inotify descriptor, will be shared with rules directory; * set to cloexec since we need our children to be able to add * watches for us */ -void 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 if (errno == ENOSYS) - info(udev, "unable to use inotify, udevd will not monitor rule files changes\n"); else err(udev, "inotify_init failed: %m\n"); + return inotify_fd; } /* move any old watches directory out of the way, and then restore