summaryrefslogtreecommitdiff
path: root/lib/common/FileStream.h
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2008-09-07 13:20:14 +0000
committerChris Wilson <chris+github@qwirx.com>2008-09-07 13:20:14 +0000
commite1c75e5922a4f031e9f8312d1f981f63bcbeb48d (patch)
treef7fba7bfecf6fb621a8c5f84c88296d411ffa928 /lib/common/FileStream.h
parentf6e4a8c70c99f8af53125223cb5e2b447bf0fcd5 (diff)
Fix test regression on Windows where a const char pointer was treated
as a file handle instead of as a string.
Diffstat (limited to 'lib/common/FileStream.h')
-rw-r--r--lib/common/FileStream.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/common/FileStream.h b/lib/common/FileStream.h
index 5efb91ea..e3ab9f46 100644
--- a/lib/common/FileStream.h
+++ b/lib/common/FileStream.h
@@ -38,6 +38,18 @@ public:
int flags = O_RDONLY,
#endif
int mode = (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH));
+
+ // Ensure that const char * name doesn't end up as a handle
+ // on Windows!
+
+ FileStream(const char *pFilename,
+#ifdef WIN32
+ int flags = (O_RDONLY | O_BINARY),
+#else
+ int flags = O_RDONLY,
+#endif
+ int mode = (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH));
+
FileStream(tOSFileHandle FileDescriptor);
virtual ~FileStream();
@@ -56,6 +68,7 @@ private:
tOSFileHandle mOSFileHandle;
bool mIsEOF;
FileStream(const FileStream &rToCopy) { /* do not call */ }
+ void AfterOpen();
// for debugging..
std::string mFileName;