summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2016-12-09 14:40:58 -0500
committerMike Frysinger <vapier@gentoo.org>2016-12-09 14:40:58 -0500
commita4187bec9c44d1c9b7388aca4f61370fc8149a2a (patch)
tree556dca285085cb1a4101c562a92442fbf65256f4
parent2d87e6abd7203b9d3a00c9c6434655f37979b327 (diff)
downloadattr-a4187bec9c44d1c9b7388aca4f61370fc8149a2a.tar.gz
attr_copy_{fd,file}: sync changes between the files
These two files are largely copies of each other but using diff APIs. Sync the minor differences between them to make `diff` more obvious. This also fixes a bug in an error message in attr_copy_fd where it had swapped the attribute name and the path.
-rw-r--r--libattr/attr_copy_fd.c34
-rw-r--r--libattr/attr_copy_file.c2
2 files changed, 18 insertions, 18 deletions
diff --git a/libattr/attr_copy_fd.c b/libattr/attr_copy_fd.c
index af237c9..34c617f 100644
--- a/libattr/attr_copy_fd.c
+++ b/libattr/attr_copy_fd.c
@@ -1,18 +1,18 @@
-/* Copyright (C) 2002 Andreas Gruenbacher <agruen@suse.de>, SuSE Linux AG.
+/*
+ Copyright (C) 2002 Andreas Gruenbacher <agruen@suse.de>, SuSE Linux AG.
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 of the License, or (at
- your option) any later version.
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
- This program is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public
- License along with this program. If not, see
- <http://www.gnu.org/licenses/>.
+ You should have received a copy of the GNU Lesser General Public License
+ along with this manual. If not, see <http://www.gnu.org/licenses/>.
*/
/* Copy extended attributes between files. */
@@ -113,7 +113,7 @@ attr_copy_fd(const char *src_path, int src_fd,
const char *qpath = quote (ctx, src_path);
const char *qname = quote (ctx, name);
error (ctx, _("getting attribute %s of %s"),
- qpath, qname);
+ qname, qpath);
quote_free (ctx, qname);
quote_free (ctx, qpath);
ret = -1;
@@ -141,16 +141,16 @@ attr_copy_fd(const char *src_path, int src_fd,
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 */
+ /* no hope of getting any further */
+ break;
} else {
const char *qname = quote (ctx, name);
- error (ctx, _("setting attribute %s for %s"),
- qname, qpath);
+ error (ctx, _("setting attribute %s for "
+ "%s"), qname, qpath);
quote_free (ctx, qname);
ret = -1;
}
diff --git a/libattr/attr_copy_file.c b/libattr/attr_copy_file.c
index 6cd8f81..3e08a21 100644
--- a/libattr/attr_copy_file.c
+++ b/libattr/attr_copy_file.c
@@ -62,7 +62,7 @@ attr_copy_file(const char *src_path, const char *dst_path,
struct error_context *ctx)
{
#if defined(HAVE_LISTXATTR) && defined(HAVE_GETXATTR) && defined(HAVE_SETXATTR)
- int ret = 0;
+ int ret = 0;
ssize_t size;
char *names = NULL, *end_names, *name, *value = NULL;
unsigned int setxattr_ENOTSUP = 0;