diff --git a/plugins/zzogl-pg/opengl/GSmain.cpp b/plugins/zzogl-pg/opengl/GSmain.cpp index 88ae0c7121..e389a1ac29 100644 --- a/plugins/zzogl-pg/opengl/GSmain.cpp +++ b/plugins/zzogl-pg/opengl/GSmain.cpp @@ -303,7 +303,7 @@ s32 CALLBACK GSinit() { FUNCLOG - if (ZZLog::Open() == false) return -1; + ZZLog::Open(); ZZLog::WriteLn("Calling GSinit."); WriteTempRegs(); diff --git a/plugins/zzogl-pg/opengl/ZZLog.cpp b/plugins/zzogl-pg/opengl/ZZLog.cpp index 6ad727a9c5..dd18e366cc 100644 --- a/plugins/zzogl-pg/opengl/ZZLog.cpp +++ b/plugins/zzogl-pg/opengl/ZZLog.cpp @@ -34,21 +34,16 @@ bool IsLogging() return (gsLog != NULL && conf.log); } -bool Open() +void Open() { - bool result = true; const std::string LogFile(s_strLogPath + "GSzzogl.log"); gsLog = fopen(LogFile.c_str(), "w"); if (gsLog != NULL) setvbuf(gsLog, NULL, _IONBF, 0); else - { SysMessage("Can't create log file %s\n", LogFile.c_str()); - result = false; - } - return result; } void Close() @@ -64,9 +59,11 @@ void SetDir(const char* dir) // Get the path to the log directory. s_strLogPath = (dir==NULL) ? "logs/" : dir; - // Reload the log file after updated the path - Close(); - Open(); + // Reload previously open log file + if (gsLog) { + Close(); + Open(); + } } void WriteToScreen(const char* pstr, u32 ms) diff --git a/plugins/zzogl-pg/opengl/ZZLog.h b/plugins/zzogl-pg/opengl/ZZLog.h index e5db14ea16..2a33ca269e 100644 --- a/plugins/zzogl-pg/opengl/ZZLog.h +++ b/plugins/zzogl-pg/opengl/ZZLog.h @@ -171,7 +171,7 @@ namespace ZZLog { extern bool IsLogging(); void SetDir(const char* dir); -extern bool Open(); +extern void Open(); extern void Close(); extern void Message(const char *fmt, ...); extern void Log(const char *fmt, ...);