Preserve file flags on symlinks in cp -Rp.

This reported ENOSYS before.

PR:		bin/111226 (part of)
Submitted by:	Martin Kammerhofer
Approved by:	ed (mentor)
MFC after:	3 weeks
This commit is contained in:
Jilles Tjoelker 2009-05-30 10:36:14 +00:00
parent 946a48449b
commit f2db75739c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=193086

View File

@ -365,7 +365,7 @@ setfile(struct stat *fs, int fd)
if (!gotstat || fs->st_flags != ts.st_flags)
if (fdval ?
fchflags(fd, fs->st_flags) :
(islink ? (errno = ENOSYS) :
(islink ? lchflags(to.p_path, fs->st_flags) :
chflags(to.p_path, fs->st_flags))) {
warn("chflags: %s", to.p_path);
rval = 1;