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:
parent
39902b5bea
commit
f698dde983
11
bin/mv/mv.c
11
bin/mv/mv.c
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user