glib/gio/kqueue
Ting-Wei Lan 6d734b895a kqueue: Do not return early from _kqsub_cancel
_kqsub_free assumes the caller has called _kqsub_cancel before calling
it. It checks if both 'deps' and 'fd' have been freed and aborts when
the condition is not met. Since the only caller of _kqsub_free is
g_kqueue_file_monitor_finalize, which does call _kqsub_cancel before
calling _kqsub_free, it seems to be correct for _kqsub_free to assert
values of these two members there.

However, it is possible for _kqsub_cancel to return early without
freeing any resource _kqsub_free expects to be freed. When the kevent
call fails, _kqsub_cancel does not free anything and _kqsub_free aborts
with assertion failure. This is an unexpected behavior, and it can be
fixed by always freeing resources in _kqsub_cancel.

Fixes: https://gitlab.gnome.org/GNOME/glib/issues/1935
2019-11-27 22:49:56 +08:00
..
dep-list.c minor typos in the documentation (a/an) 2019-08-24 19:14:05 +00:00
dep-list.h GFileMonitor: Add kqueue(3) support to GIO 2012-11-15 08:13:30 +01:00
gkqueuefilemonitor.c kqueue: Do not return early from _kqsub_cancel 2019-11-27 22:49:56 +08:00
kqueue-helper.c kqueue: Make it possible to pass file monitor tests 2018-06-17 11:26:32 +08:00
kqueue-helper.h kqueue: Make it possible to pass file monitor tests 2018-06-17 11:26:32 +08:00
kqueue-missing.c kqueue: Use the worker context to schedule rescanning of missing files 2018-06-17 11:26:32 +08:00
meson.build build: Drop use of G_DISABLE_DEPRECATED from the build system 2019-05-30 10:38:45 +01:00