On Fri, Jun 27, 2014 at 12:48:29 -0700, Xin LI wrote: > Hi, > > Craig have hit an interesting issue today, where he tried to 'mv' a file > from ZFS dataset to a NFS mount, 'mv' bails out because chflags failed. > > I think it's probably sensible to have mv ignoring UF_ARCHIVE, and set the > flag on the target unconditionally? i.e.: > > Index: mv.c > =================================================================== > --- mv.c (revision 267940) > +++ mv.c (working copy) > @@ -337,8 +337,8 @@ > * 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;
Yes, that sounds like a good way to do it. Ken -- Kenneth Merry k...@freebsd.org _______________________________________________ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"