[Box Backup-commit] COMMIT r3218 - box/trunk/lib/backupstore

subversion at boxbackup.org subversion at boxbackup.org
Fri Feb 7 21:15:27 GMT 2014


Author: chris
Date: 2014-02-07 21:15:27 +0000 (Fri, 07 Feb 2014)
New Revision: 3218

Modified:
   box/trunk/lib/backupstore/BackupCommands.cpp
Log:
Don't need to protect InvisibleTempFileStream against exceptions.

By definition, it will be cleared up by the OS automatically.

Also we don't need to support gcc 2.x any more. It was replaced by gcc3 in
2001, 12 years ago.

Modified: box/trunk/lib/backupstore/BackupCommands.cpp
===================================================================
--- box/trunk/lib/backupstore/BackupCommands.cpp	2014-02-07 21:13:48 UTC (rev 3217)
+++ box/trunk/lib/backupstore/BackupCommands.cpp	2014-02-07 21:15:27 UTC (rev 3218)
@@ -395,26 +395,10 @@
 					p + 16);
 			
 			// Open the temporary file
-			std::auto_ptr<IOStream> combined;
-			try
-			{
-				{
-					// Write nastily to allow this to work with gcc 2.x
-					std::auto_ptr<IOStream> t(
-						new InvisibleTempFileStream(
-							tempFn.c_str(), 
-							O_RDWR | O_CREAT | 
-							O_EXCL | O_BINARY | 
-							O_TRUNC));
-					combined = t;
-				}
-			}
-			catch(...)
-			{
-				// Make sure it goes
-				::unlink(tempFn.c_str());
-				throw;
-			}
+			std::auto_ptr<IOStream> combined(
+				new InvisibleTempFileStream(
+					tempFn, O_RDWR | O_CREAT | O_EXCL |
+					O_BINARY | O_TRUNC));
 			
 			// Do the combining
 			BackupStoreFile::CombineFile(*diff, *diff2, *from, *combined);




More information about the Boxbackup-commit mailing list