MacOS provides the O_EVTONLY flag to open(2) which allow to open a file
for monitoring without preventing an unmount of the volume that contains
it.
https://bugzilla.gnome.org/show_bug.cgi?id=688518
THE SOFTWARE.
*******************************************************************************/
+#include <fcntl.h>
#include <glib.h>
#include <gio/gio.h>
#include "kqueue-exclusions.h"
gboolean
_ke_is_excluded (const char *full_path)
{
+#if defined (O_EVTONLY)
+ return FALSE;
+#else
GFile *f = NULL;
GMount *mount = NULL;
}
else
return FALSE;
+#endif
}
g_assert (sub->filename != NULL);
/* kqueue requires a file descriptor to monitor. Sad but true */
+#if defined (O_EVTONLY)
+ sub->fd = open (sub->filename, O_EVTONLY);
+#else
sub->fd = open (sub->filename, O_RDONLY);
+#endif
if (sub->fd == -1)
{