[Box Backup-commit] COMMIT r1220 - box/trunk/lib/backupclient

boxbackup-dev at fluffy.co.uk boxbackup-dev at fluffy.co.uk
Fri Dec 15 00:18:52 GMT 2006


Author: chris
Date: 2006-12-15 00:18:52 +0000 (Fri, 15 Dec 2006)
New Revision: 1220

Modified:
   box/trunk/lib/backupclient/BackupClientFileAttributes.cpp
Log:

 * Remove #ifdefs around geteuid(), re-enable use of fake version under Win32 
   as requested by Ben. 

 * Restore serialised AttrModificationTime under Win32 by passing to 
   emu_utimes().

(merges [1080])


Modified: box/trunk/lib/backupclient/BackupClientFileAttributes.cpp
===================================================================
--- box/trunk/lib/backupclient/BackupClientFileAttributes.cpp	2006-12-15 00:10:51 UTC (rev 1219)
+++ box/trunk/lib/backupclient/BackupClientFileAttributes.cpp	2006-12-15 00:18:52 UTC (rev 1220)
@@ -679,10 +679,24 @@
 	{
 		// Work out times as timevals
 		struct timeval times[2];
+
+		#ifdef WIN32
+		BoxTimeToTimeval(box_ntoh64(pattr->ModificationTime), 
+			times[1]);
+		BoxTimeToTimeval(box_ntoh64(pattr->AttrModificationTime), 
+			times[0]);
+		// Because stat() returns the creation time in the ctime
+		// field under Windows, and this gets saved in the 
+		// AttrModificationTime field of the serialised attributes,
+		// we subvert the first parameter of emu_utimes() to allow
+		// it to be reset to the right value on the restored file.
+		#else
 		BoxTimeToTimeval(modtime, times[1]);
 		// Copy access time as well, why not, got to set it to something
 		times[0] = times[1];
-		// Attr modification time will be changed anyway, nothing that can be done about it
+		// Attr modification time will be changed anyway, 
+		// nothing that can be done about it
+		#endif
 		
 		// Try to apply
 		if(::utimes(Filename, times) != 0)




More information about the Boxbackup-commit mailing list