mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-05 10:38:08 +01:00
Use inotify_init1 when available
To avoid leaking the inotify fd. Fixes bug 585478.
This commit is contained in:
parent
4dbc2074bc
commit
8a3a3d797e
@ -1599,6 +1599,7 @@ inotify_support=no
|
|||||||
AC_CHECK_HEADERS([sys/inotify.h],
|
AC_CHECK_HEADERS([sys/inotify.h],
|
||||||
[
|
[
|
||||||
inotify_support=yes
|
inotify_support=yes
|
||||||
|
AC_CHECK_FUNCS(inotify_init1)
|
||||||
])
|
])
|
||||||
|
|
||||||
AM_CONDITIONAL(HAVE_INOTIFY, [test "$inotify_support" = "yes"])
|
AM_CONDITIONAL(HAVE_INOTIFY, [test "$inotify_support" = "yes"])
|
||||||
|
@ -189,7 +189,12 @@ gboolean _ik_startup (void (*cb)(ik_event_t *event))
|
|||||||
return inotify_instance_fd >= 0;
|
return inotify_instance_fd >= 0;
|
||||||
|
|
||||||
initialized = TRUE;
|
initialized = TRUE;
|
||||||
|
|
||||||
|
#ifdef HAVE_INOTIFY_INIT1
|
||||||
|
inotify_instance_fd = inotify_init1 (IN_CLOEXEC);
|
||||||
|
#else
|
||||||
inotify_instance_fd = inotify_init ();
|
inotify_instance_fd = inotify_init ();
|
||||||
|
#endif
|
||||||
|
|
||||||
if (inotify_instance_fd < 0)
|
if (inotify_instance_fd < 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user