diff options
| author | carregal <carregal> | 2008-07-31 19:34:22 +0000 |
|---|---|---|
| committer | carregal <carregal> | 2008-07-31 19:34:22 +0000 |
| commit | b8acd4ca5449bc797d98a4b7b70c8b3c8c403c80 (patch) | |
| tree | a7770946e82ce891a8907f715e8d4eb5dedab5a6 /src | |
| parent | 21412ad14cb4f0582105800cab4358659bed55e4 (diff) | |
| download | luafilesystem-b8acd4ca5449bc797d98a4b7b70c8b3c8c403c80.tar.gz luafilesystem-b8acd4ca5449bc797d98a4b7b70c8b3c8c403c80.tar.bz2 luafilesystem-b8acd4ca5449bc797d98a4b7b70c8b3c8c403c80.zip | |
Fixing bug [#13198] lfs.attributes(filename, 'size') overflow on files > 2 Gb again
(bug report and patch by KUBO Takehiro)
Diffstat (limited to 'src')
| -rw-r--r-- | src/lfs.c | 16 |
1 files changed, 8 insertions, 8 deletions
| @@ -16,10 +16,16 @@ | |||
| 16 | ** lfs.touch (filepath [, atime [, mtime]]) | 16 | ** lfs.touch (filepath [, atime [, mtime]]) |
| 17 | ** lfs.unlock (fh) | 17 | ** lfs.unlock (fh) |
| 18 | ** | 18 | ** |
| 19 | ** $Id: lfs.c,v 1.53 2008/05/07 19:06:37 carregal Exp $ | 19 | ** $Id: lfs.c,v 1.54 2008/07/31 19:34:22 carregal Exp $ |
| 20 | */ | 20 | */ |
| 21 | 21 | ||
| 22 | #define _LARGEFILE64_SOURCE | 22 | #ifndef _WIN32 |
| 23 | #ifndef _AIX | ||
| 24 | #define _FILE_OFFSET_BITS 64 /* Linux, Solaris and HP-UX */ | ||
| 25 | #else | ||
| 26 | #define _LARGE_FILES 1 /* AIX */ | ||
| 27 | #endif | ||
| 28 | #endif | ||
| 23 | 29 | ||
| 24 | #include <errno.h> | 30 | #include <errno.h> |
| 25 | #include <stdio.h> | 31 | #include <stdio.h> |
| @@ -82,16 +88,10 @@ typedef struct dir_data { | |||
| 82 | #define _O_BINARY 0 | 88 | #define _O_BINARY 0 |
| 83 | #define lfs_setmode(L,file,m) ((void)((void)file,m), \ | 89 | #define lfs_setmode(L,file,m) ((void)((void)file,m), \ |
| 84 | luaL_error(L, LUA_QL("setmode") " not supported on this platform"), -1) | 90 | luaL_error(L, LUA_QL("setmode") " not supported on this platform"), -1) |
| 85 | #ifdef HAVE_STAT64 | ||
| 86 | #define STAT_STRUCT struct stat64 | ||
| 87 | #define STAT_FUNC stat64 | ||
| 88 | #define LSTAT_FUNC lstat64 | ||
| 89 | #else | ||
| 90 | #define STAT_STRUCT struct stat | 91 | #define STAT_STRUCT struct stat |
| 91 | #define STAT_FUNC stat | 92 | #define STAT_FUNC stat |
| 92 | #define LSTAT_FUNC lstat | 93 | #define LSTAT_FUNC lstat |
| 93 | #endif | 94 | #endif |
| 94 | #endif | ||
| 95 | 95 | ||
| 96 | /* | 96 | /* |
| 97 | ** This function changes the working (current) directory | 97 | ** This function changes the working (current) directory |
