GNOME Bugzilla – Bug 724330
configure.ac: tweak inotify check
Last modified: 2014-02-14 15:43:51 UTC
Our check for inotify_init1() being defined is broken. We happily declare that inotify is supported, even if the check fails. FreeBSD has a libinotify that emulates the inotify API via kqueue. It installs a <sys/inotify.h> header and requires linking to -linotify. We don't want to falsely detect working inotify in this case.
Created attachment 269085 [details] [review] configure.ac: tweak inotify check
Comment on attachment 269085 [details] [review] configure.ac: tweak inotify check >+ AC_CHECK_FUNCS(inotify_init1, [inotify_support=yes], [inotify_support=no]) >+ if test "$inotify_support" = "yes"; then >+ AC_DEFINE(HAVE_INOTIFY, 1, [Define if we have inotify in the C library]) >+ fi you don't need the last 3 lines. AC_CHECK_FUNCS always does that, even if you also specify an action-if-found.
Interesting. We could indeed just use HAVE_INOTIFY_INIT1 instead of HAVE_INOTIFY. Will do another patch.
Created attachment 269124 [details] [review] configure.ac: tweak inotify check So it was a bit more complicated than I thought. The check for inotify_init1 was so that we could use that if it existed or fall back to inotify_init if it didn't. I think we're far enough along now that it's fine to depend on inotify_init1 existing, so let's use its existence as an indicator of if we have inotify support or not.
Comment on attachment 269124 [details] [review] configure.ac: tweak inotify check >Treat the lack of inotify_init1() in the libc as a lack of inotify >support. perhaps worth mentioning that we still support old kernels that only have inotify_init(), we just don't support old libcs.
Attachment 269124 [details] pushed as 450e7b1 - configure.ac: tweak inotify check