[Box Backup-dev] COMMIT r824 - box/chris/merge/bin/bbstored

boxbackup-dev at fluffy.co.uk boxbackup-dev at fluffy.co.uk
Wed Aug 30 19:20:09 BST 2006


Author: chris
Date: 2006-08-30 19:20:08 +0100 (Wed, 30 Aug 2006)
New Revision: 824

Modified:
   box/chris/merge/bin/bbstored/BackupContext.cpp
Log:
* bin/bbstored/BackupContext.cpp
- Revert to trunk


Modified: box/chris/merge/bin/bbstored/BackupContext.cpp
===================================================================
--- box/chris/merge/bin/bbstored/BackupContext.cpp	2006-08-30 18:17:08 UTC (rev 823)
+++ box/chris/merge/bin/bbstored/BackupContext.cpp	2006-08-30 18:20:08 UTC (rev 824)
@@ -132,7 +132,6 @@
 	// Request the lock
 	bool gotLock = mWriteLock.TryAndGetLock(writeLockFile.c_str(), 0600 /* restrictive file permissions */);
 	
-#ifndef WIN32
 	if(!gotLock)
 	{
 		// The housekeeping process might have the thing open -- ask it to stop
@@ -151,7 +150,6 @@
 			
 		} while(!gotLock && tries > 0);
 	}
-#endif
 	
 	if(gotLock)
 	{
@@ -455,21 +453,13 @@
 			try
 			{
 				// Open it twice
-#ifdef WIN32
-				FileStream diff(tempFn.c_str(), 
-					O_RDWR | O_CREAT | O_BINARY);
-				FileStream diff2(tempFn.c_str(), 
-					O_RDWR | O_BINARY);
-#else
 				FileStream diff(tempFn.c_str(), O_RDWR | O_CREAT | O_EXCL);
 				FileStream diff2(tempFn.c_str(), O_RDONLY);
-
-				// Unlink it immediately, so it definitely goes away
+				// Unlink it immediately, so it definately goes away
 				if(::unlink(tempFn.c_str()) != 0)
 				{
 					THROW_EXCEPTION(CommonException, OSFileError);
 				}
-#endif
 				
 				// Stream the incoming diff to this temporary file
 				if(!rFile.CopyStreamTo(diff, BACKUP_STORE_TIMEOUT))
@@ -518,14 +508,6 @@
 				::unlink(tempFn.c_str());
 				throw;
 			}
-
-#ifdef WIN32
-			// we can't delete the file while it's open, above
-			if(::unlink(tempFn.c_str()) != 0)
-			{
-				THROW_EXCEPTION(CommonException, OSFileError);
-			}
-#endif
 		}
 		
 		// Get the blocks used




More information about the Boxbackup-dev mailing list