[prev in list] [next in list] [prev in thread] [next in thread]
List: coreutils-bug
Subject: Re: [PATCH] mv: do not produce diagnostics for xattr/selinux
From: Jim Meyering <jim () meyering ! net>
Date: 2009-04-28 11:29:33
Message-ID: 87k555kode.fsf () meyering ! net
[Download RAW message or body]
Ondřej Vašík wrote:
> Ondřej Vašík wrote:
>> Hello,
>> as requested via IRC, adding separate test cases for patches added
>> previously in that thread. It should check correct diagnostics for
>> SELinux context/xattrs on filesystem without xattr/SELinux
>> support(fat32).
>
> Sorry for added dosfstools dependency, ext2 mounted without user xattr
> support should be sufficient, corrected patch attached...
Thank you!
I've pushed all of your changes.
I made minor changes to comments in test scripts, e.g., I replaced e.g.,
#text of comment
with this, which i find slightly more readable:
# text of comment
Plus, I factored out a tiny bit of duplication:
>From e0cf592f48b4e67dc31d0482ae4f4dbc820e883e Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Mon, 27 Apr 2009 11:35:50 +0200
Subject: [PATCH] copy.c: factor out test for errno value indicating "unsupported"
* src/copy.c (errno_unsupported): New function.
(copy_attr_error, copy_internal): Use it.
---
src/copy.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/src/copy.c b/src/copy.c
index 1687b72..511f705 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -131,6 +131,12 @@ is_ancestor (const struct stat *sb, const struct dir_list *ancestors)
return false;
}
+static bool
+errno_unsupported (int err)
+{
+ return err == ENOTSUP || err == ENODATA;
+}
+
#if USE_XATTR
static void
copy_attr_error (struct error_context *ctx ATTRIBUTE_UNUSED,
@@ -139,6 +145,7 @@ copy_attr_error (struct error_context *ctx ATTRIBUTE_UNUSED,
int err = errno;
va_list ap;
+ if (!errno_unsupported (errno))
if (errno != ENOTSUP && errno != ENODATA)
{
/* use verror module to print error message */
@@ -1764,7 +1771,7 @@ copy_internal (char const *src_name, char const *dst_name,
}
else
{
- if ((errno != ENOTSUP && errno != ENODATA) || x->require_preserve_context)
+ if (!errno_unsupported (errno) || x->require_preserve_context)
{
if (!x->reduce_diagnostics || x->require_preserve_context)
error (0, errno,
--
1.6.3.rc3.184.g9852e
_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic