mirror of
https://github.com/lunarmodules/luafilesystem.git
synced 2026-07-25 05:03:07 +00:00
Fixing bug [#13198] lfs.attributes(filename, 'size') overflow on files > 2 Gb again
(bug report and patch by KUBO Takehiro)
This commit is contained in:
16
src/lfs.c
16
src/lfs.c
@@ -16,10 +16,16 @@
|
|||||||
** lfs.touch (filepath [, atime [, mtime]])
|
** lfs.touch (filepath [, atime [, mtime]])
|
||||||
** lfs.unlock (fh)
|
** 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 <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -82,16 +88,10 @@ typedef struct dir_data {
|
|||||||
#define _O_BINARY 0
|
#define _O_BINARY 0
|
||||||
#define lfs_setmode(L,file,m) ((void)((void)file,m), \
|
#define lfs_setmode(L,file,m) ((void)((void)file,m), \
|
||||||
luaL_error(L, LUA_QL("setmode") " not supported on this platform"), -1)
|
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_STRUCT struct stat
|
||||||
#define STAT_FUNC stat
|
#define STAT_FUNC stat
|
||||||
#define LSTAT_FUNC lstat
|
#define LSTAT_FUNC lstat
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** This function changes the working (current) directory
|
** This function changes the working (current) directory
|
||||||
|
|||||||
Reference in New Issue
Block a user