[ostree] Add some verbose log output when xattr functions fail



commit 97947373eebc7671922be706cf3eee1504d19295
Author: Stef Walter <stefw redhat com>
Date:   Tue Aug 13 15:42:06 2013 +0200

    Add some verbose log output when xattr functions fail
    
    If any of the system xattr functions fail, clearly write out the
    reason in the verbose log output.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=705893

 src/libostree/ostree-core.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/libostree/ostree-core.c b/src/libostree/ostree-core.c
index b8f3988..8dc2b96 100644
--- a/src/libostree/ostree-core.c
+++ b/src/libostree/ostree-core.c
@@ -187,6 +187,7 @@ read_xattr_name_array (const char *path,
       if (bytes_read < 0)
         {
           ot_util_set_error_from_errno (error, errno);
+          g_prefix_error (error, "lgetxattr (%s, %s) failed: ", path, p);
           goto out;
         }
       if (bytes_read == 0)
@@ -196,6 +197,7 @@ read_xattr_name_array (const char *path,
       if (lgetxattr (path, p, buf, bytes_read) < 0)
         {
           ot_util_set_error_from_errno (error, errno);
+          g_prefix_error (error, "lgetxattr (%s, %s) failed: ", path, p);
           g_free (buf);
           goto out;
         }
@@ -240,6 +242,7 @@ ostree_get_xattrs_for_file (GFile         *f,
       if (errno != ENOTSUP)
         {
           ot_util_set_error_from_errno (error, errno);
+          g_prefix_error (error, "llistxattr (%s) failed: ", path);
           goto out;
         }
     }
@@ -249,6 +252,7 @@ ostree_get_xattrs_for_file (GFile         *f,
       if (llistxattr (path, xattr_names, bytes_read) < 0)
         {
           ot_util_set_error_from_errno (error, errno);
+          g_prefix_error (error, "llistxattr (%s) failed: ", path);
           goto out;
         }
       xattr_names_canonical = canonicalize_xattrs (xattr_names, bytes_read);
@@ -865,6 +869,7 @@ ostree_set_xattrs (GFile  *f,
       if (loop_err)
         {
           ot_util_set_error_from_errno (error, errno);
+          g_prefix_error (error, "lsetxattr (%s, %s) failed: ", path, name);
           goto out;
         }
     }


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