From: Toni Wilen Date: Sat, 25 Oct 2014 16:35:36 +0000 (+0300) Subject: 32-bit filesystem packet 2G-1 to 4G-1 max size change. X-Git-Tag: 3000~18 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=045a9cf925a2b7735b9ca81257cc6cac4cb5d184;p=francis%2Fwinuae.git 32-bit filesystem packet 2G-1 to 4G-1 max size change. --- diff --git a/filesys.cpp b/filesys.cpp index a37ed61b..7592463a 100644 --- a/filesys.cpp +++ b/filesys.cpp @@ -1050,7 +1050,15 @@ struct hardfiledata *get_hardfile_data (int nr) #define ST_SOFTLINK 3 #define ST_LINKDIR 4 +#if 1 +#define MAXFILESIZE32 (0xffffffff) +#else +/* technically correct but most native + * filesystems don't enforce it + */ #define MAXFILESIZE32 (0x7fffffff) +#endif +#define MAXFILESIZE32_2G (0x7fffffff) /* Passed as type to Lock() */ #define SHARED_LOCK -2 /* File is readable by others */ @@ -3786,7 +3794,7 @@ static void if (longfilesize) { /* MorphOS 64-bit file length support */ - put_long (info + 124, statbuf.size > MAXFILESIZE32 ? 0 : (uae_u32)statbuf.size); + put_long (info + 124, statbuf.size > MAXFILESIZE32_2G ? 0 : (uae_u32)statbuf.size); put_long (info + 228, statbuf.size >> 32); put_long (info + 232, (uae_u32)statbuf.size); put_long (info + 236, numblocks >> 32); @@ -5374,7 +5382,7 @@ static void } /* Fail if file is >=2G, it is not safe operation. */ - if (fs_fsize64 (k->fd) > MAXFILESIZE32) { + if (fs_fsize64 (k->fd) > MAXFILESIZE32_2G) { PUT_PCK_RES1 (packet, DOS_TRUE); PUT_PCK_RES2 (packet, ERROR_BAD_NUMBER); /* ? */ return;