[Box Backup-commit] COMMIT r2395 - in box/trunk/lib: common win32

boxbackup-dev@boxbackup.org boxbackup-dev@boxbackup.org
Mon, 1 Dec 2008 01:31:52 +0000 (GMT)


Author: chris
Date: 2008-12-01 01:31:51 +0000 (Mon, 01 Dec 2008)
New Revision: 2395

Modified:
   box/trunk/lib/common/BoxPlatform.h
   box/trunk/lib/win32/emu.h
Log:
Fix the use of an unreasonably short type as the temporary storage
for inode numbers on Windows, resulting in all inode numbers being
coerced into 2^16 space and many duplicates on systems with large
numbers of files being backed up, possibly resulting in store
corruption due to unwanted file rename operations.


Modified: box/trunk/lib/common/BoxPlatform.h
===================================================================
--- box/trunk/lib/common/BoxPlatform.h	2008-12-01 00:59:49 UTC (rev 2394)
+++ box/trunk/lib/common/BoxPlatform.h	2008-12-01 01:31:51 UTC (rev 2395)
@@ -38,6 +38,10 @@
 		// must define this before importing <sys/types.h>
 		#define __MSVCRT_VERSION__ 0x0601
 	#endif
+
+	// stop sys/types.h from defining its own ino_t as short,
+	// because we want a bigger one :)
+	#define _INO_T_
 #endif
 
 #ifdef HAVE_SYS_TYPES_H

Modified: box/trunk/lib/win32/emu.h
===================================================================
--- box/trunk/lib/win32/emu.h	2008-12-01 00:59:49 UTC (rev 2394)
+++ box/trunk/lib/win32/emu.h	2008-12-01 01:31:51 UTC (rev 2395)
@@ -25,6 +25,9 @@
 
 #ifdef __MINGW32__
 	typedef uint32_t u_int32_t;
+	typedef uint64_t _ino_t;
+	typedef _ino_t ino_t;
+	#define _INO_T_
 #else
 	typedef unsigned int mode_t;
 	typedef unsigned int pid_t;