diff options
Diffstat (limited to 'backends/platform/sdl')
-rw-r--r-- | backends/platform/sdl/posix/posix.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/backends/platform/sdl/posix/posix.cpp b/backends/platform/sdl/posix/posix.cpp index b2a8e14e40..8b065e131a 100644 --- a/backends/platform/sdl/posix/posix.cpp +++ b/backends/platform/sdl/posix/posix.cpp @@ -167,26 +167,33 @@ Common::WriteStream *OSystem_POSIX::createLogFile() { // of a failure, we know that no log file is open. _logFilePath.clear(); - const char *home = getenv("HOME"); - if (home == NULL) - return 0; - + const char *prefix = nullptr; Common::String logFile; #ifdef MACOSX + prefix = getenv("HOME"); + if (prefix == nullptr) { + return 0; + } + logFile = "Library/Logs"; #elif SAMSUNGTV - home = nullptr; + prefix = nullptr; logFile = "/mtd_ram"; #else + prefix = getenv("HOME"); + if (prefix == nullptr) { + return 0; + } + logFile = ".scummvm/logs"; #endif - if (!assureDirectoryExists(logFile, home)) { + if (!assureDirectoryExists(logFile, prefix)) { return 0; } - if (home) { - logFile = Common::String::format("%s/%s", home, logFile.c_str()); + if (prefix) { + logFile = Common::String::format("%s/%s", prefix, logFile.c_str()); } logFile += "/scummvm.log"; |