[ostree/wip/gs-dir-iter: 2/2] deploy: Update to use latest libgsystem API



commit 6b7803320442a5c85b0fdc960ed473782f2da6fe
Author: Colin Walters <walters verbum org>
Date:   Sat Jan 3 12:03:36 2015 -0500

    deploy: Update to use latest libgsystem API

 src/libostree/ostree-sysroot-deploy.c |   29 +++++------------------------
 1 files changed, 5 insertions(+), 24 deletions(-)
---
diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c
index 40dd7b5..3baa9a3 100644
--- a/src/libostree/ostree-sysroot-deploy.c
+++ b/src/libostree/ostree-sysroot-deploy.c
@@ -33,25 +33,6 @@
 #define OSTREE_CONFIGMERGE_ID         "d3863baec13e4449ab0384684a8af3a7"
 #define OSTREE_DEPLOYMENT_COMPLETE_ID "dd440e3e549083b63d0efc7dc15255f1"
 
-/* FIXME when we depend on new enough libgsystem, move to
- * gs_dfd_and_name_get_all_xattrs().
- */
-static gboolean
-dfd_and_name_get_all_xattrs (int            dfd,
-                             const char    *name,
-                             GVariant     **out_xattrs,
-                             GCancellable  *cancellable,
-                             GError       **error)
-{
-  /* A workaround for the lack of lgetxattrat(), thanks to Florian Weimer:
-   * https://mail.gnome.org/archives/ostree-list/2014-February/msg00017.html
-   */
-  gs_free char *path = g_strdup_printf ("/proc/self/fd/%d/%s", dfd, name);
-  gs_unref_object GFile *fpath = g_file_new_for_path (path);
-  return gs_file_get_all_xattrs (fpath, out_xattrs,
-                                 cancellable, error);
-}
-
 static gboolean
 copy_one_file_fsync_at (int              src_parent_dfd,
                         int              dest_parent_dfd,
@@ -63,9 +44,9 @@ copy_one_file_fsync_at (int              src_parent_dfd,
   gboolean ret = FALSE;
   gs_unref_variant GVariant *src_xattrs = NULL;
 
-  if (!dfd_and_name_get_all_xattrs (src_parent_dfd, name,
-                                    &src_xattrs,
-                                    cancellable, error))
+  if (!gs_dfd_and_name_get_all_xattrs (src_parent_dfd, name,
+                                       &src_xattrs,
+                                       cancellable, error))
     goto out;
 
   if (S_ISREG (stbuf->st_mode))
@@ -171,8 +152,8 @@ dirfd_copy_attributes_and_xattrs (int            src_parent_dfd,
    * right.  This will allow other users access if they have ACLs, but
    * oh well.
    */ 
-  if (!dfd_and_name_get_all_xattrs (src_parent_dfd, src_name,
-                                    &xattrs, cancellable, error))
+  if (!gs_dfd_and_name_get_all_xattrs (src_parent_dfd, src_name,
+                                       &xattrs, cancellable, error))
     goto out;
   if (!gs_fd_set_all_xattrs (dest_dfd, xattrs,
                              cancellable, error))


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