Fossil SCM

Use _stati64() rather than stat() on windows, in order to support repositories larger than 2GB.

drh 2010-09-18 21:48 trunk
Commit 293238031fb092cc8bd0c47d5b3e52d137a894be
1 file changed +9 -1
+9 -1
--- src/file.c
+++ src/file.c
@@ -23,12 +23,20 @@
2323
#include <unistd.h>
2424
#include "file.h"
2525
2626
/*
2727
** The file status information from the most recent stat() call.
28
+**
29
+** Use _stati64 rather than stat on windows, in order to handle files
30
+** larger than 2GB.
2831
*/
29
-static struct stat fileStat;
32
+#if defined(_WIN32) && defined(__MSVCRT__)
33
+ static struct _stati64 fileStat;
34
+# define stat _stati64
35
+#else
36
+ static struct stat fileStat;
37
+#endif
3038
static int fileStatValid = 0;
3139
3240
/*
3341
** Fill in the fileStat variable for the file named zFilename.
3442
** If zFilename==0, then use the previous value of fileStat if
3543
--- src/file.c
+++ src/file.c
@@ -23,12 +23,20 @@
23 #include <unistd.h>
24 #include "file.h"
25
26 /*
27 ** The file status information from the most recent stat() call.
 
 
 
28 */
29 static struct stat fileStat;
 
 
 
 
 
30 static int fileStatValid = 0;
31
32 /*
33 ** Fill in the fileStat variable for the file named zFilename.
34 ** If zFilename==0, then use the previous value of fileStat if
35
--- src/file.c
+++ src/file.c
@@ -23,12 +23,20 @@
23 #include <unistd.h>
24 #include "file.h"
25
26 /*
27 ** The file status information from the most recent stat() call.
28 **
29 ** Use _stati64 rather than stat on windows, in order to handle files
30 ** larger than 2GB.
31 */
32 #if defined(_WIN32) && defined(__MSVCRT__)
33 static struct _stati64 fileStat;
34 # define stat _stati64
35 #else
36 static struct stat fileStat;
37 #endif
38 static int fileStatValid = 0;
39
40 /*
41 ** Fill in the fileStat variable for the file named zFilename.
42 ** If zFilename==0, then use the previous value of fileStat if
43

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button