[glib/glib-2-54] kqueue: Fix invalid emission of G_FILE_MONITOR_EVENT_MOVED event



commit 38ec9c6da3c0140a10f0b89ddd127a4b4eb5b828
Author: Philip Withnall <withnall endlessm com>
Date:   Fri Nov 10 15:10:26 2017 +0000

    kqueue: Fix invalid emission of G_FILE_MONITOR_EVENT_MOVED event
    
    That event is deprecated, and the kqueue backend can’t provide enough
    information to go alongside the event (i.e. the name of the new file).
    Use G_FILE_MONITOR_EVENT_DELETED instead.
    
    Quite disappointed in the kqueue documentation for this: I cannot find a
    single piece of documentation or example about how NOTE_RENAME is
    supposed to communicate the new name of the file.
    
    If it turns out that this is possible, the code can be amended again in
    future. At least now it doesn’t abort.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=776147

 gio/kqueue/kqueue-helper.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gio/kqueue/kqueue-helper.c b/gio/kqueue/kqueue-helper.c
index d4e66cd..e7d583c 100644
--- a/gio/kqueue/kqueue-helper.c
+++ b/gio/kqueue/kqueue-helper.c
@@ -97,8 +97,10 @@ convert_kqueue_events_to_gio (uint32_t flags, gboolean *done)
     }
   if (flags & NOTE_RENAME)
     {
+      /* Since there’s apparently no way to get the new name of the file out of
+       * kqueue(), all we can do is say that this one has been deleted. */
       *done = TRUE;
-      return G_FILE_MONITOR_EVENT_MOVED;
+      return G_FILE_MONITOR_EVENT_DELETED;
     }
   if (flags & NOTE_REVOKE)
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]