From 07d662531ce7ce3de8a88e2f6d04614077e248a3 Mon Sep 17 00:00:00 2001 From: sada Date: Thu, 20 Jul 2000 18:30:00 +0000 Subject: Don't emit a warning message if fchflags() returns EOPNOTSUPP Requested by: FUJISHIMA Satsuki Obtained from: OpenBSD --- bin/mv/mv.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'bin/mv') 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; -- cgit v1.1