[Box Backup-commit] COMMIT r1364 - box/chris/general/lib/win32

boxbackup-dev at fluffy.co.uk boxbackup-dev at fluffy.co.uk
Mon Mar 5 00:00:42 GMT 2007


Author: chris
Date: 2007-03-05 00:00:42 +0000 (Mon, 05 Mar 2007)
New Revision: 1364

Modified:
   box/chris/general/lib/win32/emu.cpp
Log:
Improve GetErrorMessage() by including the error number/code in the message
(helps debugging on foreign langauge versions of Windows)


Modified: box/chris/general/lib/win32/emu.cpp
===================================================================
--- box/chris/general/lib/win32/emu.cpp	2007-03-04 23:58:19 UTC (rev 1363)
+++ box/chris/general/lib/win32/emu.cpp	2007-03-05 00:00:42 UTC (rev 1364)
@@ -9,15 +9,16 @@
 
 #include <assert.h>
 #include <fcntl.h>
+#include <process.h>
 #include <windows.h>
 
 #ifdef HAVE_UNISTD_H
 	#include <unistd.h>
 #endif
-#include <process.h>
 
 #include <string>
 #include <list>
+#include <sstream>
 
 // message resource definitions for syslog()
 
@@ -502,10 +503,11 @@
 		return std::string("failed to get error message");
 	}
 
-	std::string out(pMsgBuf);
+	std::ostringstream line;
+	line << pMsgBuf << " (" << errorCode << ")";
 	LocalFree(pMsgBuf);
 
-	return out;
+	return line.str();
 }
 
 // --------------------------------------------------------------------------




More information about the Boxbackup-commit mailing list