diff options
author | delphij <delphij@FreeBSD.org> | 2014-06-27 19:57:54 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2014-06-27 19:57:54 +0000 |
commit | 8015212d04e705b06b7914e7f1a706cede984a3b (patch) | |
tree | 453dd7ab9af351ecd08716e04351e53efebedf17 /bin/mv | |
parent | 75aefa2c4afb0af7205e14d2acd028dbe34e9e12 (diff) | |
download | FreeBSD-src-8015212d04e705b06b7914e7f1a706cede984a3b.zip FreeBSD-src-8015212d04e705b06b7914e7f1a706cede984a3b.tar.gz |
Always set UF_ARCHIVE on target (because they are by definition new files
and should be archived) and ignore error when we can't set it (e.g. NFS).
Reviewed by: ken
MFC after: 2 weeks
Diffstat (limited to 'bin/mv')
-rw-r--r-- | bin/mv/mv.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/mv/mv.c b/bin/mv/mv.c index 2710f89..ee52643 100644 --- a/bin/mv/mv.c +++ b/bin/mv/mv.c @@ -337,8 +337,8 @@ err: if (unlink(to)) * on a file that we copied, i.e., that we didn't create.) */ errno = 0; - if (fchflags(to_fd, sbp->st_flags)) - if (errno != EOPNOTSUPP || sbp->st_flags != 0) + if (fchflags(to_fd, sbp->st_flags | UF_ARCHIVE)) + if (errno != EOPNOTSUPP || ((sbp->st_flags & ~UF_ARCHIVE) != 0)) warn("%s: set flags (was: 0%07o)", to, sbp->st_flags); tval[0].tv_sec = sbp->st_atime; |