From b8acd4ca5449bc797d98a4b7b70c8b3c8c403c80 Mon Sep 17 00:00:00 2001 From: carregal Date: Thu, 31 Jul 2008 19:34:22 +0000 Subject: Fixing bug [#13198] lfs.attributes(filename, 'size') overflow on files > 2 Gb again (bug report and patch by KUBO Takehiro) --- src/lfs.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/lfs.c b/src/lfs.c index f465082..bbf1ba3 100644 --- a/src/lfs.c +++ b/src/lfs.c @@ -16,10 +16,16 @@ ** lfs.touch (filepath [, atime [, mtime]]) ** lfs.unlock (fh) ** -** $Id: lfs.c,v 1.53 2008/05/07 19:06:37 carregal Exp $ +** $Id: lfs.c,v 1.54 2008/07/31 19:34:22 carregal Exp $ */ -#define _LARGEFILE64_SOURCE +#ifndef _WIN32 +#ifndef _AIX +#define _FILE_OFFSET_BITS 64 /* Linux, Solaris and HP-UX */ +#else +#define _LARGE_FILES 1 /* AIX */ +#endif +#endif #include #include @@ -82,16 +88,10 @@ typedef struct dir_data { #define _O_BINARY 0 #define lfs_setmode(L,file,m) ((void)((void)file,m), \ luaL_error(L, LUA_QL("setmode") " not supported on this platform"), -1) -#ifdef HAVE_STAT64 -#define STAT_STRUCT struct stat64 -#define STAT_FUNC stat64 -#define LSTAT_FUNC lstat64 -#else #define STAT_STRUCT struct stat #define STAT_FUNC stat #define LSTAT_FUNC lstat #endif -#endif /* ** This function changes the working (current) directory -- cgit v1.2.3-55-g6feb