diff options
author | SADA Kenji <sada@FreeBSD.org> | 2000-07-20 18:30:00 +0000 |
---|---|---|
committer | SADA Kenji <sada@FreeBSD.org> | 2000-07-20 18:30:00 +0000 |
commit | f698dde9834dd0c512f5151233bc761306ef000c (patch) | |
tree | f071655963cb18522cfbcbb63cc7ae5640546d28 /bin/mv | |
parent | 39902b5bea8ef339a6fb7154f20d6fa7c6d262f8 (diff) | |
download | src-f698dde9834dd0c512f5151233bc761306ef000c.tar.gz src-f698dde9834dd0c512f5151233bc761306ef000c.zip |
Don't emit a warning message if fchflags() returns EOPNOTSUPP
Requested by: FUJISHIMA Satsuki <k5@cheerful.com>
Obtained from: OpenBSD
Notes
Notes:
svn path=/head/; revision=63680
Diffstat (limited to 'bin/mv')
-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 4a9825b03a6f..fe7a2ed0dc3a 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; |