summaryrefslogtreecommitdiff
path: root/gio/glocalfilemonitor.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2015-08-19 07:10:01 -0400
committerMatthias Clasen <mclasen@redhat.com>2015-08-19 14:57:53 -0400
commitac78d14125a39f1677a5a5d77bb8ab4cb5f2d3c9 (patch)
tree3be07ca8df049e0b0f0f12b0e243317d5c15c4f8 /gio/glocalfilemonitor.c
parent780b48c4cdc97ca5607ba15bc73ce5cc64d67c04 (diff)
inotify: Fix handling of paired events for atomic replace
After the big file monitoring rewrite, we only put the IN_MOVED_FROM event in the queue for such pairs. It matches INOTIFY_DIR_MASK and thus we call ip_dispatch_event on it, but that function was filtering it out because the filename in the 'from' event is the one of the temp file, not the one we are monitoring. That name is in the 'to' event, so compare it as well, and let the event passin that case. There is another instance of this check in glocalfilemonitor.c, which is corrected here as well. https://bugzilla.gnome.org/show_bug.cgi?id=751358
Diffstat (limited to 'gio/glocalfilemonitor.c')
-rw-r--r--gio/glocalfilemonitor.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gio/glocalfilemonitor.c b/gio/glocalfilemonitor.c
index dcd39cf18..62d269c79 100644
--- a/gio/glocalfilemonitor.c
+++ b/gio/glocalfilemonitor.c
@@ -344,7 +344,8 @@ g_file_monitor_source_handle_event (GFileMonitorSource *fms,
g_assert (!child || is_basename (child));
g_assert (!rename_to || is_basename (rename_to));
- if (fms->basename && (!child || !g_str_equal (child, fms->basename)))
+ if (fms->basename && (!child || !g_str_equal (child, fms->basename))
+ && (!rename_to || !g_str_equal (rename_to, fms->basename)))
return TRUE;
g_mutex_lock (&fms->lock);
@@ -408,7 +409,6 @@ g_file_monitor_source_handle_event (GFileMonitorSource *fms,
other = g_local_file_new_from_dirname_and_basename (fms->dirname, rename_to);
g_file_monitor_source_file_changes_done (fms, rename_to);
- g_print ("send %s %s\n", child, g_file_get_path (other));
g_file_monitor_source_send_event (fms, G_FILE_MONITOR_EVENT_MOVED, child, other);
g_object_unref (other);
}