1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00

Don't emit a warning message if fchflags() returns EOPNOTSUPP

Requested by:	FUJISHIMA Satsuki <k5@cheerful.com>
Obtained from:	OpenBSD
This commit is contained in:
SADA Kenji 2000-07-20 18:30:00 +00:00
parent 39902b5bea
commit f698dde983
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=63680

View File

@ -290,8 +290,17 @@ err: if (unlink(to))
}
if (fchmod(to_fd, sbp->st_mode))
warn("%s: set mode (was: 0%03o)", to, oldmode);
/*
* XXX
* NFS doesn't support chflags; ignore errors unless there's reason
* to believe we're losing bits. (Note, this still won't be right
* if the server supports flags and we were trying to *remove* flags
* on a file that we copied, i.e., that we didn't create.)
*/
errno = 0;
if (fchflags(to_fd, sbp->st_flags))
warn("%s: set flags (was: 0%07o)", to, sbp->st_flags);
if (errno != EOPNOTSUPP || sbp->st_flags != 0)
warn("%s: set flags (was: 0%07o)", to, sbp->st_flags);
tval[0].tv_sec = sbp->st_atime;
tval[1].tv_sec = sbp->st_mtime;