[Box Backup-commit] COMMIT r1061 - box/chris/merge/bin/bbstored

boxbackup-dev at fluffy.co.uk boxbackup-dev at fluffy.co.uk
Sun Oct 15 20:49:12 BST 2006


Author: chris
Date: 2006-10-15 20:49:11 +0100 (Sun, 15 Oct 2006)
New Revision: 1061

Modified:
   box/chris/merge/bin/bbstored/BackupContext.cpp
Log:
Revert patch [862] (refs #3)


Modified: box/chris/merge/bin/bbstored/BackupContext.cpp
===================================================================
--- box/chris/merge/bin/bbstored/BackupContext.cpp	2006-10-15 19:36:01 UTC (rev 1060)
+++ box/chris/merge/bin/bbstored/BackupContext.cpp	2006-10-15 19:49:11 UTC (rev 1061)
@@ -125,6 +125,7 @@
 // --------------------------------------------------------------------------
 bool BackupContext::AttemptToGetWriteLock()
 {
+#ifndef WIN32
 	// Make the filename of the write lock file
 	std::string writeLockFile;
 	StoreStructure::MakeWriteLockFilename(mStoreRoot, mStoreDiscSet, writeLockFile);
@@ -158,6 +159,10 @@
 	}
 	
 	return gotLock;
+#else // WIN32
+	// no housekeeping process, we do have the lock
+	return true;
+#endif // !WIN32
 }
 
 
@@ -461,6 +466,12 @@
 #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
+				if(::unlink(tempFn.c_str()) != 0)
+				{
+					THROW_EXCEPTION(CommonException, OSFileError);
+				}
 #endif
 				
 				// Stream the incoming diff to this temporary file
@@ -503,14 +514,6 @@
 				spaceAdjustFromDiff = from->GetDiscUsageInBlocks() - oldVersionNewBlocksUsed;
 
 				// Everything cleans up here...
-				diff.Close();
-				diff2.Close();
-
-				// Unlink the temporary file
-				if(::unlink(tempFn.c_str()) != 0)
-				{
-					THROW_EXCEPTION(CommonException, OSFileError);
-				}
 			}
 			catch(...)
 			{




More information about the Boxbackup-commit mailing list