[Box Backup-commit] COMMIT r989 - box/trunk/bin/bbstored
boxbackup-dev at fluffy.co.uk
boxbackup-dev at fluffy.co.uk
Thu Oct 12 22:35:40 BST 2006
Author: chris
Date: 2006-10-12 22:35:39 +0100 (Thu, 12 Oct 2006)
New Revision: 989
Modified:
box/trunk/bin/bbstored/BackupCommands.cpp
Log:
* Use the same code for file names and file closing on other platforms
that's needed on Win32
Modified: box/trunk/bin/bbstored/BackupCommands.cpp
===================================================================
--- box/trunk/bin/bbstored/BackupCommands.cpp 2006-10-12 21:06:04 UTC (rev 988)
+++ box/trunk/bin/bbstored/BackupCommands.cpp 2006-10-12 21:35:39 UTC (rev 989)
@@ -10,6 +10,7 @@
#include "Box.h"
#include <syslog.h>
+#include <sstream>
#include "autogen_BackupProtocolServer.h"
#include "BackupConstants.h"
@@ -327,8 +328,11 @@
std::auto_ptr<IOStream> diff2(rContext.OpenObject(patchID));
// Choose a temporary filename for the result of the combination
- std::string tempFn(RaidFileController::DiscSetPathToFileSystemPath(rContext.GetStoreDiscSet(), rContext.GetStoreRoot() + ".recombinetemp",
- p + 16 /* rotate which disc it's on */));
+ std::ostringstream fs(rContext.GetStoreRoot());
+ fs << ".recombinetemp.";
+ fs << p;
+ std::string tempFn(fs.str());
+ tempFn = RaidFileController::DiscSetPathToFileSystemPath(rContext.GetStoreDiscSet(), tempFn, p + 16);
// Open the temporary file
std::auto_ptr<IOStream> combined;
@@ -359,6 +363,7 @@
combined->Seek(0, IOStream::SeekType_Absolute);
// Then shuffle round for the next go
+ if (from.get()) from->Close();
from = combined;
}
More information about the Boxbackup-commit
mailing list