diff options
author | sada <sada@FreeBSD.org> | 2000-07-20 18:30:00 +0000 |
---|---|---|
committer | sada <sada@FreeBSD.org> | 2000-07-20 18:30:00 +0000 |
commit | 07d662531ce7ce3de8a88e2f6d04614077e248a3 (patch) | |
tree | 859767b8623ac85fb395cae99966487c4cd8be8d | |
parent | 45faab1699fb95c56e4d9e7f9554a169d8a97c33 (diff) | |
download | FreeBSD-src-07d662531ce7ce3de8a88e2f6d04614077e248a3.zip FreeBSD-src-07d662531ce7ce3de8a88e2f6d04614077e248a3.tar.gz |
Don't emit a warning message if fchflags() returns EOPNOTSUPP
Requested by: FUJISHIMA Satsuki <k5@cheerful.com>
Obtained from: OpenBSD
-rw-r--r-- | bin/mv/mv.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/bin/mv/mv.c b/bin/mv/mv.c index 4a9825b..fe7a2ed 100644 --- a/bin/mv/mv.c +++ b/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; |