[gnome-settings-daemon] housekeeping: Don't remove X11's socket when cleaning tmp



commit 5f295f67042ee856a1e4b4b2193d1ef3ece0be15
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Mar 1 18:36:43 2016 +0100

    housekeeping: Don't remove X11's socket when cleaning tmp
    
    https://bugzilla.gnome.org/show_bug.cgi?id=761317

 plugins/housekeeping/gsd-disk-space.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/plugins/housekeeping/gsd-disk-space.c b/plugins/housekeeping/gsd-disk-space.c
index a08efeb..6ab80b1 100644
--- a/plugins/housekeeping/gsd-disk-space.c
+++ b/plugins/housekeeping/gsd-disk-space.c
@@ -399,7 +399,6 @@ delete_subdir_check_symlink (GObject      *source,
         GFile *file = G_FILE (source);
         DeleteData *data = user_data;
         GFileInfo *info;
-        GFileType type;
 
         info = g_file_query_info_finish (file, res, NULL);
         if (!info) {
@@ -407,16 +406,15 @@ delete_subdir_check_symlink (GObject      *source,
                 return;
         }
 
-        type = g_file_info_get_file_type (info);
-        g_object_unref (info);
-
-        if (type == G_FILE_TYPE_SYMBOLIC_LINK) {
+        if (g_file_info_get_file_type (info) == G_FILE_TYPE_SYMBOLIC_LINK) {
                 if (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);
                         }
                 }
+        } else if (g_strcmp0 (g_file_info_get_name (info), ".X11-unix") == 0) {
+                g_debug ("Skipping X11 socket directory");
         } else {
                 g_file_enumerate_children_async (data->file,
                                                  G_FILE_ATTRIBUTE_STANDARD_NAME ","
@@ -427,6 +425,7 @@ delete_subdir_check_symlink (GObject      *source,
                                                  delete_subdir,
                                                  delete_data_ref (data));
         }
+        g_object_unref (info);
         delete_data_unref (data);
 }
 
@@ -440,6 +439,7 @@ delete_recursively_by_age (DeleteData *data)
         }
 
         g_file_query_info_async (data->file,
+                                 G_FILE_ATTRIBUTE_STANDARD_NAME ","
                                  G_FILE_ATTRIBUTE_STANDARD_TYPE,
                                  G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
                                  0,


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