[ostree] core: Don't use g_file_delete(), it calls into g_vfs_get_default()



commit b5ce7606784060a78beedadf5c0faf93a571f053
Author: Colin Walters <walters verbum org>
Date:   Fri Dec 2 14:32:25 2011 -0500

    core: Don't use g_file_delete(), it calls into g_vfs_get_default()
    
    For some (probably crazy) reason.  Skipping this and calling
    unlink() directly makes 'strace' MUCH smaller.

 src/libostree/ostree-repo.c         |    8 ++++----
 src/ostree/ot-builtin-compose.c     |    2 +-
 src/ostree/ot-builtin-local-clone.c |    2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c
index 5470c1e..6d90e6f 100644
--- a/src/libostree/ostree-repo.c
+++ b/src/libostree/ostree-repo.c
@@ -620,7 +620,7 @@ stage_and_checksum (OstreeRepo       *self,
     }
  out:
   if (tmp_f)
-    (void) g_file_delete (tmp_f, NULL, NULL);
+    (void) unlink (ot_gfile_get_path_cached (tmp_f));
   g_clear_object (&tmp_f);
   g_clear_object (&stream);
   g_clear_object (&ret_tmpname);
@@ -694,7 +694,7 @@ import_gvariant_object (OstreeRepo  *self,
   *out_checksum = ret_checksum;
   ret_checksum = NULL;
  out:
-  (void) g_file_delete (tmp_path, NULL, NULL);
+  (void) unlink (ot_gfile_get_path_cached (tmp_path));
   g_clear_object (&tmp_path);
   ot_clear_checksum (&ret_checksum);
   return ret;
@@ -1002,7 +1002,7 @@ ostree_repo_store_file (OstreeRepo         *self,
   ret_checksum = NULL;
  out:
   if (temp_file)
-    (void) g_file_delete (temp_file, NULL, NULL);
+    (void) unlink (ot_gfile_get_path_cached (temp_file));
   g_clear_object (&temp_file);
   g_clear_object (&temp_out);
   g_clear_object (&input);
@@ -1048,7 +1048,7 @@ ostree_repo_store_packfile (OstreeRepo       *self,
   ret = TRUE;
  out:
   if (tempfile)
-    (void) g_file_delete (tempfile, NULL, NULL);
+    (void) unlink (ot_gfile_get_path_cached (tempfile));
   g_clear_object (&tempfile);
   g_clear_object (&src);
   ot_clear_checksum (&checksum);
diff --git a/src/ostree/ot-builtin-compose.c b/src/ostree/ot-builtin-compose.c
index 8e7f285..2f1c4eb 100644
--- a/src/ostree/ot-builtin-compose.c
+++ b/src/ostree/ot-builtin-compose.c
@@ -67,7 +67,7 @@ rm_rf (GFile *path)
         }
     }
 
-  (void) g_file_delete (path, NULL, NULL);
+  (void) unlink (ot_gfile_get_path_cached (path));
 
  out:
   g_clear_object (&finfo);
diff --git a/src/ostree/ot-builtin-local-clone.c b/src/ostree/ot-builtin-local-clone.c
index 7d440b5..f6c8245 100644
--- a/src/ostree/ot-builtin-local-clone.c
+++ b/src/ostree/ot-builtin-local-clone.c
@@ -134,7 +134,7 @@ object_iter_callback (OstreeRepo   *repo,
 
  out:
   if (dest)
-    (void) g_file_delete (dest, NULL, NULL);
+    (void) unlink (ot_gfile_get_path_cached (dest));
   g_clear_object (&dest);
   if (error != NULL)
     {



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