]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Log message if winuaelog.txt open failed
authorToni Wilen <twilen@winuae.net>
Sat, 15 Apr 2023 18:08:54 +0000 (21:08 +0300)
committerToni Wilen <twilen@winuae.net>
Sat, 15 Apr 2023 18:08:54 +0000 (21:08 +0300)
od-win32/win32.cpp
od-win32/win32.h

index 79ad3eea574b5f811f03d9a530189b1a84525219..d573c92da2b0525b3e36fa8e8d5b618b24dd0123 100644 (file)
@@ -3530,13 +3530,13 @@ void toggle_mousegrab(void)
 static bool createbootlog = true;
 static bool logging_disabled = false;
 
-void logging_open (int bootlog, int append)
+bool logging_open(int bootlog, int append)
 {
        TCHAR *outpath;
        TCHAR debugfilename[MAX_DPATH];
 
        if (logging_disabled && !winuaelog_temporary_enable)
-               return;
+               return true;
 
        outpath = logpath;
        debugfilename[0] = 0;
@@ -3553,8 +3553,10 @@ void logging_open (int bootlog, int append)
        if (debugfilename[0]) {
                if (!debugfile)
                        debugfile = log_open (debugfilename, append, bootlog, outpath);
+               return debugfile != NULL;
        }
 #endif
+       return true;
 }
 
 typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL);
@@ -3578,9 +3580,12 @@ void logging_init (void)
                        start_path_data, LOG_NORMAL);
                if (debugfile)
                        log_close (debugfile);
-               debugfile = 0;
+               debugfile = NULL;
+       }
+       bool ok = logging_open(first ? 0 : 1, 0);
+       if (first == 1 && !ok) {
+               write_log(_T("Failed to create log file.\n"));
        }
-       logging_open (first ? 0 : 1, 0);
        logging_started = 1;
        first++;
 
index e2259957892209a00a2b48f6278ca762f58739c7..de9c059c8d332d39df1923bac223609018db6a0c 100644 (file)
@@ -175,8 +175,8 @@ extern unsigned int fpucontrol;
 extern void fpux_save (int *v);
 extern void fpux_restore (int *v);
 
-extern void logging_open (int,int);
-extern void logging_cleanup (void);
+extern bool logging_open(int,int);
+extern void logging_cleanup(void);
 
 extern LONG WINAPI WIN32_ExceptionFilter (struct _EXCEPTION_POINTERS *pExceptionPointers, DWORD ec);