From: Colin Walters Date: Tue, 16 Mar 2010 16:16:33 +0000 (-0400) Subject: Support inotify on older kernels X-Git-Tag: dbus-1.2.22~12 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8586e83a5c2a0e53964ad6c26b452e2b7709085f;p=thirdparty%2Fdbus.git Support inotify on older kernels https://bugs.freedesktop.org/show_bug.cgi?id=23957 Previously we detected glibc support at compile time and used it unconditionally; better to try it and fall back, this way we continue to run on older kernels when compiled for newer ones. --- diff --git a/bus/dir-watch-inotify.c b/bus/dir-watch-inotify.c index c98e6fcb0..094993bb5 100644 --- a/bus/dir-watch-inotify.c +++ b/bus/dir-watch-inotify.c @@ -226,6 +226,11 @@ _init_inotify (BusContext *context) { #ifdef HAVE_INOTIFY_INIT1 inotify_fd = inotify_init1 (IN_CLOEXEC); + /* This ensures we still run on older Linux kernels. + * https://bugs.freedesktop.org/show_bug.cgi?id=23957 + */ + if (inotify_fd < 0) + inotify_fd = inotify_init (); #else inotify_fd = inotify_init (); #endif