diff options
Diffstat (limited to 'bin/cp')
-rw-r--r-- | bin/cp/extern.h | 3 | ||||
-rw-r--r-- | bin/cp/utils.c | 18 |
2 files changed, 3 insertions, 18 deletions
diff --git a/bin/cp/extern.h b/bin/cp/extern.h index 91d40d57da6..42b94317c98 100644 --- a/bin/cp/extern.h +++ b/bin/cp/extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: extern.h,v 1.14 2015/01/16 06:39:31 deraadt Exp $ */ +/* $OpenBSD: extern.h,v 1.15 2015/12/26 18:11:43 guenther Exp $ */ /* $NetBSD: extern.h,v 1.3 1995/03/21 09:02:16 cgd Exp $ */ /*- @@ -50,6 +50,5 @@ int copy_file(FTSENT *, int); int copy_link(FTSENT *, int); int copy_special(struct stat *, int); int setfile(struct stat *, int); -int setlink(struct stat *); void usage(void); __END_DECLS diff --git a/bin/cp/utils.c b/bin/cp/utils.c index 980244ae679..6a3c5178647 100644 --- a/bin/cp/utils.c +++ b/bin/cp/utils.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utils.c,v 1.38 2015/11/16 21:35:58 tedu Exp $ */ +/* $OpenBSD: utils.c,v 1.39 2015/12/26 18:11:43 guenther Exp $ */ /* $NetBSD: utils.c,v 1.6 1997/02/26 14:40:51 cgd Exp $ */ /*- @@ -217,7 +217,7 @@ copy_link(FTSENT *p, int exists) warn("symlink: %s", name); return (1); } - return (pflag ? setlink(p->fts_statp) : 0); + return (pflag ? setfile(p->fts_statp, -1) : 0); } int @@ -303,20 +303,6 @@ setfile(struct stat *fs, int fd) } -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); -} - - void usage(void) { |