summaryrefslogtreecommitdiff
path: root/bin/mv
diff options
context:
space:
mode:
Diffstat (limited to 'bin/mv')
-rw-r--r--bin/mv/cp.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/bin/mv/cp.c b/bin/mv/cp.c
index eec87a04a94..aefc8bfd3c4 100644
--- a/bin/mv/cp.c
+++ b/bin/mv/cp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cp.c,v 1.5 2015/11/17 19:11:11 tedu Exp $ */
+/* $OpenBSD: cp.c,v 1.6 2015/12/26 18:11:43 guenther Exp $ */
/* $NetBSD: cp.c,v 1.14 1995/09/07 06:14:51 jtc Exp $ */
/*
@@ -79,7 +79,6 @@ static int copy_file(FTSENT *, int);
static int copy_link(FTSENT *, int);
static int copy_special(struct stat *, int);
static int setfile(struct stat *, int);
-static int setlink(struct stat *);
extern char *__progname;
@@ -387,7 +386,7 @@ copy(char *argv[], enum op type, int fts_options)
}
-/* $OpenBSD: cp.c,v 1.5 2015/11/17 19:11:11 tedu Exp $ */
+/* $OpenBSD: cp.c,v 1.6 2015/12/26 18:11:43 guenther Exp $ */
/* $NetBSD: utils.c,v 1.6 1997/02/26 14:40:51 cgd Exp $ */
/*-
@@ -587,7 +586,7 @@ copy_link(FTSENT *p, int exists)
warn("symlink: %s", linkname);
return (1);
}
- return (setlink(p->fts_statp));
+ return (setfile(p->fts_statp, -1));
}
static int
@@ -671,17 +670,3 @@ setfile(struct stat *fs, int fd)
}
return (rval);
}
-
-
-static int
-setlink(struct stat *fs)
-{
-
- if (lchown(to.p_path, fs->st_uid, fs->st_gid)) {
- if (errno != EPERM) {
- warn("lchown: %s", to.p_path);
- return (1);
- }
- }
- return (0);
-}