diff options
Diffstat (limited to 'goo')
-rw-r--r-- | goo/gfile.cc | 6 | ||||
-rw-r--r-- | goo/gfile.h | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/goo/gfile.cc b/goo/gfile.cc index 819559c0..c2973416 100644 --- a/goo/gfile.cc +++ b/goo/gfile.cc @@ -270,6 +270,10 @@ GooString *appendToPath(GooString *path, const char *fileName) { #endif } +int openFileDescriptor(const char *path, int flags) { + return open(path, flags); +} + FILE *openFile(const char *path, const char *mode) { #ifdef _WIN32 OSVERSIONINFO version; @@ -485,7 +489,7 @@ GooFile* GooFile::open(const GooString *fileName) { #ifdef VMS int fd = ::open(fileName->c_str(), Q_RDONLY, "ctx=stm"); #else - int fd = ::open(fileName->c_str(), O_RDONLY); + int fd = openFileDescriptor(fileName->c_str(), O_RDONLY); #endif return fd < 0 ? nullptr : new GooFile(fd); diff --git a/goo/gfile.h b/goo/gfile.h index bd58e6c0..b0b942fd 100644 --- a/goo/gfile.h +++ b/goo/gfile.h @@ -88,6 +88,9 @@ typedef long long Goffset; // string, denoting the current directory). Returns <path>. extern GooString *appendToPath(GooString *path, const char *fileName); +// Open a file descriptor +extern int openFileDescriptor(const char *path, int flags); + // Open a file. On Windows, this converts the path from UTF-8 to // UCS-2 and calls _wfopen (if available). On other OSes, this simply // calls fopen. |