mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03:00
mv: ignore xattr-preservation failure when not supported by filesystem
*src/copy.c: Do not warn about xattr-preservation failure when xattrs are not supported and preservation of xattrs is not explicitly required. Reported by Eric Sandeen in http://bugzilla.redhat.com/496142
This commit is contained in:
1 parent
819ee4272b
commit
941bd48235
2 files changed
+21
-2
No files matched your search
@@ -13,6 +13,9 @@ GNU coreutils NEWS -*- outline -*-
|
|||||||
|
|
||||||
ls -v and sort -V now order names like "#.b#" properly
|
ls -v and sort -V now order names like "#.b#" properly
|
||||||
|
|
||||||
|
mv: do not print diagnostics when failing to preserve xattr's on file
|
||||||
|
systems without xattr support.
|
||||||
|
|
||||||
** Changes in behavior
|
** Changes in behavior
|
||||||
|
|
||||||
shred, sort, shuf: now use an internal pseudorandom generator by default.
|
shred, sort, shuf: now use an internal pseudorandom generator by default.
|
||||||
|
|||||||
+18
-2
@@ -139,6 +139,22 @@ copy_attr_error (struct error_context *ctx ATTRIBUTE_UNUSED,
|
|||||||
int err = errno;
|
int err = errno;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
|
if (errno != ENOTSUP && errno != ENODATA)
|
||||||
|
{
|
||||||
|
/* use verror module to print error message */
|
||||||
|
va_start (ap, fmt);
|
||||||
|
verror (0, err, fmt, ap);
|
||||||
|
va_end (ap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
copy_attr_allerror (struct error_context *ctx ATTRIBUTE_UNUSED,
|
||||||
|
char const *fmt, ...)
|
||||||
|
{
|
||||||
|
int err = errno;
|
||||||
|
va_list ap;
|
||||||
|
|
||||||
/* use verror module to print error message */
|
/* use verror module to print error message */
|
||||||
va_start (ap, fmt);
|
va_start (ap, fmt);
|
||||||
verror (0, err, fmt, ap);
|
verror (0, err, fmt, ap);
|
||||||
@@ -163,7 +179,7 @@ copy_attr_by_fd (char const *src_path, int src_fd,
|
|||||||
{
|
{
|
||||||
struct error_context ctx =
|
struct error_context ctx =
|
||||||
{
|
{
|
||||||
.error = copy_attr_error,
|
.error = x->require_preserve_xattr ? copy_attr_allerror : copy_attr_error,
|
||||||
.quote = copy_attr_quote,
|
.quote = copy_attr_quote,
|
||||||
.quote_free = copy_attr_free
|
.quote_free = copy_attr_free
|
||||||
};
|
};
|
||||||
@@ -177,7 +193,7 @@ copy_attr_by_name (char const *src_path, char const *dst_path,
|
|||||||
{
|
{
|
||||||
struct error_context ctx =
|
struct error_context ctx =
|
||||||
{
|
{
|
||||||
.error = copy_attr_error,
|
.error = x->require_preserve_xattr ? copy_attr_allerror : copy_attr_error,
|
||||||
.quote = copy_attr_quote,
|
.quote = copy_attr_quote,
|
||||||
.quote_free = copy_attr_free
|
.quote_free = copy_attr_free
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user