diff options
author | Andreas Gruenbacher <agruen@linbit.com> | 2012-09-21 22:55:52 +0200 |
---|---|---|
committer | Andreas Gruenbacher <agruen@linbit.com> | 2012-09-22 18:32:10 +0200 |
commit | d24f630fbcaf27416fa81b3bcd686df4344df978 (patch) | |
tree | 725659412e79fa1ba546e3b277da4648a77a8a3d | |
parent | 1d9d403394750474c339dd1473119a0794361240 (diff) | |
download | patch-d24f630fbcaf27416fa81b3bcd686df4344df978.tar.gz |
Ignore when preserving extended attributes is not supported or allowed
* src/common.h (ENOTSUP): Make sure this error code is defined.
* src/util.c (set_file_attributes): Ignore ENOSYS, ENOTSUP, and EPERM errors.
-rw-r--r-- | src/common.h | 4 | ||||
-rw-r--r-- | src/util.c | 15 |
2 files changed, 13 insertions, 6 deletions
diff --git a/src/common.h b/src/common.h index a66e55f..41b719f 100644 --- a/src/common.h +++ b/src/common.h @@ -214,3 +214,7 @@ bool merge_hunk (int hunk, struct outstate *, lin where, bool *); #else # define merge_hunk(hunk, outstate, where, somefailed) false #endif + +#ifndef ENOTSUP +#define ENOTSUP (-1) +#endif @@ -179,10 +179,13 @@ copy_attr_error (struct error_context *ctx, char const *fmt, ...) int err = errno; va_list ap; - /* use verror module to print error message */ - va_start (ap, fmt); - verror (0, err, fmt, ap); - va_end (ap); + if (err != ENOSYS && err != ENOTSUP && err != EPERM) + { + /* use verror module to print error message */ + va_start (ap, fmt); + verror (0, err, fmt, ap); + va_end (ap); + } } static char const * @@ -274,9 +277,9 @@ set_file_attributes (char const *to, enum file_attributes attr, quotearg (to)); } if (attr & FA_XATTRS) - if (copy_attr (from, to)) + if (copy_attr (from, to) != 0 + && errno != ENOSYS && errno != ENOTSUP && errno != EPERM) fatal_exit (0); - /* FIXME: There may be other attributes to preserve. */ if (attr & FA_MODE) { #if 0 && defined HAVE_LCHMOD |