After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 724330 - tweak inotify check tweak inotify check
Product: glib
Classification: Platform
Component: general
Other All
: Normal normal
: ---
Assigned To: gtkdev
Depends on:
Reported: 2014-02-13 23:31 UTC by Allison Karlitskaya (desrt)
Modified: 2014-02-14 15:43 UTC
See Also:
GNOME target: ---
GNOME version: ---

Attachments tweak inotify check (1.79 KB, patch)
2014-02-13 23:31 UTC, Allison Karlitskaya (desrt)
reviewed Details | Review tweak inotify check (2.41 KB, patch)
2014-02-14 14:36 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Allison Karlitskaya (desrt) 2014-02-13 23:31:03 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.
Comment 1 Allison Karlitskaya (desrt) 2014-02-13 23:31:05 UTC
Created attachment 269085 [details] [review] tweak inotify check
Comment 2 Dan Winship 2014-02-14 13:40:56 UTC
Comment on attachment 269085 [details] [review] 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.
Comment 3 Allison Karlitskaya (desrt) 2014-02-14 14:29:43 UTC
Interesting.  We could indeed just use HAVE_INOTIFY_INIT1 instead of HAVE_INOTIFY.  Will do another patch.
Comment 4 Allison Karlitskaya (desrt) 2014-02-14 14:36:13 UTC
Created attachment 269124 [details] [review] 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 5 Dan Winship 2014-02-14 15:16:36 UTC
Comment on attachment 269124 [details] [review] tweak inotify check

>Treat the lack of inotify_init1() in the libc as a lack of inotify

perhaps worth mentioning that we still support old kernels that only have inotify_init(), we just don't support old libcs.
Comment 6 Allison Karlitskaya (desrt) 2014-02-14 15:43:48 UTC
Attachment 269124 [details] pushed as 450e7b1 - tweak inotify check