svn commit: r267977 - head/bin/mv

Xin LI delphij at FreeBSD.org
Fri Jun 27 19:57:55 UTC 2014


Author: delphij
Date: Fri Jun 27 19:57:54 2014
New Revision: 267977
URL: http://svnweb.freebsd.org/changeset/base/267977

Log:
  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

Modified:
  head/bin/mv/mv.c

Modified: head/bin/mv/mv.c
==============================================================================
--- head/bin/mv/mv.c	Fri Jun 27 19:50:30 2014	(r267976)
+++ head/bin/mv/mv.c	Fri Jun 27 19:57:54 2014	(r267977)
@@ -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;


More information about the svn-src-head mailing list