Update packfile.c
This seems to fix any issues compiling android or windows ports don't know if changing the file open mode will have any negative impact but on a test everything seems fine no file corruption games load and run as they should from both pak file or data folder.
@@ -436,7 +436,7 @@ int openPackfile(const char *filename, const char *packfilename)
packfilepointer[h] = 0;
// Separate file present?
- if((handle = open(filename, O_RDONLY | O_BINARY, 777)) != -1)
+ if((handle = open(filename, O_RDONLY | O_BINARY, 0)) != -1)
{
if((packfilesize[h] = lseek(handle, 0, SEEK_END)) == -1)
{
@@ -463,7 +463,7 @@ int openPackfile(const char *filename, const char *packfilename)
fspath = casesearch(".", filename);
if (fspath != NULL)
{
- if((handle = open(fspath, O_RDONLY | O_BINARY, 777)) != -1)
+ if((handle = open(fspath, O_RDONLY | O_BINARY, 0)) != -1)
{
if((packfilesize[h] = lseek(handle, 0, SEEK_END)) == -1)
{
@@ -493,7 +493,7 @@ int openPackfile(const char *filename, const char *packfilename)
#endif
// Try to open packfile
- if((handle = open(packfilename, O_RDONLY | O_BINARY, 777)) == -1)
+ if((handle = open(packfilename, O_RDONLY | O_BINARY, 0) == -1)
{
#ifdef VERBOSE
printf ("perm err\n");
@@ -1246,7 +1246,7 @@ int pak_init()
{
#endif
- pakfd = open(packfile, O_RDONLY | O_BINARY, 777);
+ pakfd = open(packfile, O_RDONLY | O_BINARY, 0);
if(pakfd < 0)
{
@@ -1262,7 +1262,7 @@ int pak_init()
// Is it a valid Packfile
close(pakfd);
- pakfd = open(packfile, O_RDONLY | O_BINARY, 777);
+ pakfd = open(packfile, O_RDONLY | O_BINARY, 0);
// Read magic dword ("PACK")
if(read(pakfd, &magic, 4) != 4 || magic != SwapLSB32(PACKMAGIC))
