aboutsummaryrefslogtreecommitdiff
path: root/toys/posix
diff options
context:
space:
mode:
Diffstat (limited to 'toys/posix')
-rw-r--r--toys/posix/cp.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/toys/posix/cp.c b/toys/posix/cp.c
index 751a718c..e37b360d 100644
--- a/toys/posix/cp.c
+++ b/toys/posix/cp.c
@@ -278,20 +278,20 @@ static int cp_node(struct dirtree *try)
// We only copy xattrs for files because there's no flistxattrat()
if (TT.pflags&(_CP_xattr|_CP_context)) {
- ssize_t listlen = flistxattr(fdin, 0, 0), len;
+ ssize_t listlen = xattr_flist(fdin, 0, 0), len;
char *name, *value, *list;
if (listlen>0) {
list = xmalloc(listlen);
- flistxattr(fdin, list, listlen);
+ xattr_flist(fdin, list, listlen);
list[listlen-1] = 0; // I do not trust this API.
for (name = list; name-list < listlen; name += strlen(name)+1) {
if (!(TT.pflags&_CP_xattr) && strncmp(name, "security.", 9))
continue;
- if ((len = fgetxattr(fdin, name, 0, 0))>0) {
+ if ((len = xattr_fget(fdin, name, 0, 0))>0) {
value = xmalloc(len);
- if (len == fgetxattr(fdin, name, value, len))
- if (fsetxattr(fdout, name, value, len, 0))
+ if (len == xattr_fget(fdin, name, value, len))
+ if (xattr_fset(fdout, name, value, len, 0))
perror_msg("%s setxattr(%s=%s)", catch, name, value);
free(value);
}