mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 23:13:40 +02:00
Use inotify_init1 when available
To avoid leaking the inotify fd. Fixes bug 585478.
This commit is contained in:
@@ -187,10 +187,15 @@ gboolean _ik_startup (void (*cb)(ik_event_t *event))
|
||||
/* Ignore multi-calls */
|
||||
if (initialized)
|
||||
return inotify_instance_fd >= 0;
|
||||
|
||||
|
||||
initialized = TRUE;
|
||||
|
||||
#ifdef HAVE_INOTIFY_INIT1
|
||||
inotify_instance_fd = inotify_init1 (IN_CLOEXEC);
|
||||
#else
|
||||
inotify_instance_fd = inotify_init ();
|
||||
|
||||
#endif
|
||||
|
||||
if (inotify_instance_fd < 0)
|
||||
return FALSE;
|
||||
|
||||
|
Reference in New Issue
Block a user