diff options
author | Nathan Scott <nathans@sgi.com> | 2005-06-07 03:53:01 +0000 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2005-06-07 03:53:01 +0000 |
commit | 3c39672164e2de512b7015e8798a55332e4595c9 (patch) | |
tree | ba46af3daaf0d11401707e78a95f77d64743c8dd | |
parent | 925ee348492bcd7496ad0ff4ea60fe2e54c35c8d (diff) | |
download | attr-3c39672164e2de512b7015e8798a55332e4595c9.tar.gz |
Reduce verbosity when copying attributes between files.
Merge of master-melb:xfs-cmds:22833a by kenmcd.
-rw-r--r-- | VERSION | 4 | ||||
-rw-r--r-- | debian/changelog | 4 | ||||
-rw-r--r-- | doc/CHANGES | 5 | ||||
-rw-r--r-- | libattr/attr_copy_fd.c | 42 | ||||
-rw-r--r-- | libattr/attr_copy_file.c | 42 |
5 files changed, 63 insertions, 34 deletions
@@ -3,5 +3,5 @@ # PKG_MAJOR=2 PKG_MINOR=4 -PKG_REVISION=22 -PKG_BUILD=1 +PKG_REVISION=23 +PKG_BUILD=0 diff --git a/debian/changelog b/debian/changelog index 38bd62f..ff92c3e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -attr (2.4.22-1) unstable; urgency=low +attr (2.4.23-1) unstable; urgency=low * New upstream release - -- Nathan Scott <nathans@debian.org> Mon, 21 Feb 2005 08:13:36 +1100 + -- Nathan Scott <nathans@debian.org> Tue, 07 Jun 2005 09:10:32 +1000 attr (2.4.21-1) unstable; urgency=low diff --git a/doc/CHANGES b/doc/CHANGES index fce03ed..6baea91 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -1,3 +1,8 @@ +attr-2.4.23 (3 June 2005) + - attr_copy_{fd,file}: Reduce verboseness for ENOTSUP errors. + ENOTSUPP is common when copying between xattr enabled and + xattr disabled file systems. + attr-2.4.22 (21 February 2005) - Allocate the line buffer dynamically when reading from a file. This mainly fixes restoring of large attributes. diff --git a/libattr/attr_copy_fd.c b/libattr/attr_copy_fd.c index 6b9a0d7..17b87d8 100644 --- a/libattr/attr_copy_fd.c +++ b/libattr/attr_copy_fd.c @@ -69,6 +69,7 @@ attr_copy_fd(const char *src_path, int src_fd, int ret = 0; ssize_t size; char *names = NULL, *end_names, *name, *value = NULL; + unsigned int setxattr_ENOTSUP = 0; /* ignore acls by default */ if (check == NULL) @@ -137,24 +138,35 @@ attr_copy_fd(const char *src_path, int src_fd, quote_free (ctx, qpath); ret = -1; } - if (fsetxattr (dst_fd, name, value, size, 0) != 0) - { - const char *qpath = quote (ctx, dst_path); - if (errno == ENOSYS) { - error (ctx, _("setting attributes for %s"), - qpath); - ret = -1; - break; /* no hope of getting any further */ - } else { - const char *qname = quote (ctx, name); - error (ctx, _("setting attribute %s for %s"), - qname, qpath); - quote_free (ctx, qname); - ret = -1; + if (fsetxattr (dst_fd, name, value, size, 0) != 0) { + if (errno == ENOTSUP) + setxattr_ENOTSUP++; + else { + const char *qpath = quote (ctx, dst_path); + + if (errno == ENOSYS) { + error (ctx, _("setting attributes for " + "%s"), qpath); + ret = -1; + break; /* no hope of getting any further */ + } else { + const char *qname = quote (ctx, name); + error (ctx, _("setting attribute %s for %s"), + qname, qpath); + quote_free (ctx, qname); + ret = -1; + } + quote_free (ctx, qpath); } - quote_free (ctx, qpath); } } + if (setxattr_ENOTSUP) { + const char *qpath = quote (ctx, dst_path); + errno = ENOTSUP; + error (ctx, _("setting attributes for %s"), qpath); + ret = -1; + quote_free (ctx, qpath); + } getout: free (value); my_free (names); diff --git a/libattr/attr_copy_file.c b/libattr/attr_copy_file.c index 2b93276..b137678 100644 --- a/libattr/attr_copy_file.c +++ b/libattr/attr_copy_file.c @@ -67,6 +67,7 @@ attr_copy_file(const char *src_path, const char *dst_path, int ret = 0; ssize_t size; char *names = NULL, *end_names, *name, *value = NULL; + unsigned int setxattr_ENOTSUP = 0; /* ignore acls by default */ if (check == NULL) @@ -135,24 +136,35 @@ attr_copy_file(const char *src_path, const char *dst_path, quote_free (ctx, qpath); ret = -1; } - if (lsetxattr (dst_path, name, value, size, 0) != 0) - { - const char *qpath = quote (ctx, dst_path); - if (errno == ENOSYS) { - error (ctx, _("setting attributes for %s"), - qpath); - ret = -1; - break; /* no hope of getting any further */ - } else { - const char *qname = quote (ctx, name); - error (ctx, _("setting attribute %s for %s"), - qname, qpath); - quote_free (ctx, qname); - ret = -1; + if (lsetxattr (dst_path, name, value, size, 0) != 0) { + if (errno == ENOTSUP) + setxattr_ENOTSUP++; + else { + const char *qpath = quote (ctx, dst_path); + if (errno == ENOSYS) { + error (ctx, _("setting attributes for " + "%s"), qpath); + ret = -1; + /* no hope of getting any further */ + break; + } else { + const char *qname = quote (ctx, name); + error (ctx, _("setting attribute %s for" + "%s"), qname, qpath); + quote_free (ctx, qname); + ret = -1; + } + quote_free (ctx, qpath); } - quote_free (ctx, qpath); } } + if (setxattr_ENOTSUP) { + const char *qpath = quote (ctx, dst_path); + errno = ENOTSUP; + error (ctx, _("setting attributes for %s"), qpath); + ret = -1; + quote_free (ctx, qpath); + } getout: free (value); my_free (names); |