aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/sdl/posix/posix.cpp
diff options
context:
space:
mode:
authorMax Horn2011-06-03 12:08:37 +0200
committerMax Horn2011-06-03 13:36:04 +0200
commit279a5b4f32ebd9ed9df4390995e4bfc4da38f1df (patch)
tree49f607b86dbc35cb94365e3bb8ad475ddfdc6be1 /backends/platform/sdl/posix/posix.cpp
parentae4b298bbb41a37a73b0b10eb021d9730bd8b839 (diff)
downloadscummvm-rg350-279a5b4f32ebd9ed9df4390995e4bfc4da38f1df.tar.gz
scummvm-rg350-279a5b4f32ebd9ed9df4390995e4bfc4da38f1df.tar.bz2
scummvm-rg350-279a5b4f32ebd9ed9df4390995e4bfc4da38f1df.zip
BACKENDS: Add OSystem::displayLogFile interface + OSX implementation
Diffstat (limited to 'backends/platform/sdl/posix/posix.cpp')
-rw-r--r--backends/platform/sdl/posix/posix.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/backends/platform/sdl/posix/posix.cpp b/backends/platform/sdl/posix/posix.cpp
index 21ad7b9e35..f30b953a8f 100644
--- a/backends/platform/sdl/posix/posix.cpp
+++ b/backends/platform/sdl/posix/posix.cpp
@@ -73,6 +73,10 @@ Common::String OSystem_POSIX::getDefaultConfigFileName() {
}
Common::WriteStream *OSystem_POSIX::createLogFile() {
+ // Start out by resetting _logFilePath, so that in case
+ // of a failure, we know that no log file is open.
+ _logFilePath.clear();
+
const char *home = getenv("HOME");
if (home == NULL)
return 0;
@@ -128,7 +132,10 @@ Common::WriteStream *OSystem_POSIX::createLogFile() {
logFile += "/scummvm.log";
Common::FSNode file(logFile);
- return file.createWriteStream();
+ Common::WriteStream *stream = file.createWriteStream();
+ if (stream)
+ _logFilePath = logFile;
+ return stream;
}
#endif