Fossil SCM
Use _stati64() rather than stat() on windows, in order to support repositories larger than 2GB.
Commit
293238031fb092cc8bd0c47d5b3e52d137a894be
Parent
7fbaee790a40022…
1 file changed
+9
-1
+9
-1
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -23,12 +23,20 @@ | ||
| 23 | 23 | #include <unistd.h> |
| 24 | 24 | #include "file.h" |
| 25 | 25 | |
| 26 | 26 | /* |
| 27 | 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. | |
| 28 | 31 | */ |
| 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 | |
| 30 | 38 | static int fileStatValid = 0; |
| 31 | 39 | |
| 32 | 40 | /* |
| 33 | 41 | ** Fill in the fileStat variable for the file named zFilename. |
| 34 | 42 | ** If zFilename==0, then use the previous value of fileStat if |
| 35 | 43 |
| --- 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 |