From 97947373eebc7671922be706cf3eee1504d19295 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Tue, 13 Aug 2013 15:42:06 +0200 Subject: [PATCH] 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 file changed, 5 insertions(+) diff --git a/src/libostree/ostree-core.c b/src/libostree/ostree-core.c index b8f39884..8dc2b960 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; } }