[gnome-settings-daemon] housekeeping: When the enumerator fails on leaf nodes, delete them.
- From: Srinivasa Ragavan <sragavan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] housekeeping: When the enumerator fails on leaf nodes, delete them.
- Date: Tue, 20 Aug 2013 13:55:54 +0000 (UTC)
commit d7155a09fb99b904b9085eff00f721ebbb602349
Author: Srinivasa Ragavan <srinivasa ragavan venkateswaran intel com>
Date: Tue Aug 20 19:23:35 2013 +0530
housekeeping: When the enumerator fails on leaf nodes, delete them.
https://bugzilla.gnome.org/show_bug.cgi?id=701528
plugins/housekeeping/gsd-disk-space.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/plugins/housekeeping/gsd-disk-space.c b/plugins/housekeeping/gsd-disk-space.c
index 93703eb..2e4878d 100644
--- a/plugins/housekeeping/gsd-disk-space.c
+++ b/plugins/housekeeping/gsd-disk-space.c
@@ -405,7 +405,6 @@ delete_subdir (GObject *source,
if (error) {
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_DIRECTORY))
g_warning ("Failed to enumerate children of %s: %s\n", data->name, error->message);
- g_error_free (error);
}
if (enumerator) {
g_file_enumerator_next_files_async (enumerator, 20,
@@ -413,7 +412,18 @@ delete_subdir (GObject *source,
data->cancellable,
delete_batch,
delete_data_ref (data));
+ } else if (data->depth > 0 && g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_DIRECTORY)) {
+ if ((data->trash && data->depth > 1) ||
+ should_purge_file (data->file, data->cancellable, data->old)) {
+ g_debug ("Purging %s leaf node", data->name);
+ if (!data->dry_run) {
+ g_file_delete (data->file, data->cancellable, NULL);
+ }
+ }
}
+
+ if (error)
+ g_error_free (error);
delete_data_unref (data);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]