diff options
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | hw/xwin/InitOutput.c | 17 | ||||
-rw-r--r-- | hw/xwin/winerror.c | 9 | ||||
-rw-r--r-- | hw/xwin/winglobals.c | 4 | ||||
-rwxr-xr-x | hw/xwin/winprocarg.c | 2 | ||||
-rw-r--r-- | hw/xwin/winshaddd.c | 2 | ||||
-rw-r--r-- | include/xwin-config.h.in | 2 |
7 files changed, 22 insertions, 15 deletions
diff --git a/configure.ac b/configure.ac index 3e8ea10d5..065016f29 100644 --- a/configure.ac +++ b/configure.ac @@ -1829,6 +1829,7 @@ AC_MSG_RESULT([$XWIN]) if test "x$XWIN" = xyes; then PKG_CHECK_EXISTS($WINDOWSWMPROTO, [WINDOWSWM=yes], [WINDOWSWM=no]) AC_DEFINE_DIR(SYSCONFDIR, sysconfdir, [Location of system.XWinrc]) + AC_DEFINE_DIR(DEFAULT_LOGDIR, logdir, [Default log location]) AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version]) AC_DEFINE_UNQUOTED(__VENDORDWEBSUPPORT__, ["$VENDOR_WEB"], [Vendor web address for support]) AC_CHECK_TOOL(WINDRES, windres) diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index d8fd59f6c..175cd9d81 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -69,7 +69,7 @@ extern int g_iLastScreen; extern char * g_pszCommandLine; extern Bool g_fSilentFatalError; -extern char * g_pszLogFile; +extern const char * g_pszLogFile; extern Bool g_fLogFileChanged; extern int g_iLogVerbose; Bool g_fLogInited; @@ -244,7 +244,7 @@ ddxGiveUp (void) #endif if (!g_fLogInited) { - LogInit (g_pszLogFile, NULL); + g_pszLogFile = LogInit (g_pszLogFile, NULL); g_fLogInited = TRUE; } LogClose (); @@ -689,9 +689,6 @@ OsVendorInit (void) /* Re-initialize global variables on server reset */ winInitializeGlobals (); - LogInit (NULL, NULL); - LogSetParameter (XLOG_VERBOSITY, g_iLogVerbose); - winFixupPaths(); #ifdef DDXOSVERRORF @@ -706,7 +703,7 @@ OsVendorInit (void) * avoid the second call */ g_fLogInited = TRUE; - LogInit (g_pszLogFile, NULL); + g_pszLogFile = LogInit (g_pszLogFile, NULL); } LogSetParameter (XLOG_FLUSH, 1); LogSetParameter (XLOG_VERBOSITY, g_iLogVerbose); @@ -927,7 +924,7 @@ ddxUseMsg(void) /* Log file will not be opened for UseMsg unless we open it now */ if (!g_fLogInited) { - LogInit (g_pszLogFile, NULL); + g_pszLogFile = LogInit (g_pszLogFile, NULL); g_fLogInited = TRUE; } LogClose (); @@ -935,9 +932,9 @@ ddxUseMsg(void) /* Notify user where UseMsg text can be found.*/ if (!g_fNoHelpMessageBox) winMessageBoxF ("The " PROJECT_NAME " help text has been printed to " - "/tmp/XWin.log.\n" - "Please open /tmp/XWin.log to read the help text.\n", - MB_ICONINFORMATION); + "%s.\n" + "Please open %s to read the help text.\n", + MB_ICONINFORMATION, g_pszLogFile, g_pszLogFile); } /* See Porting Layer Definition - p. 20 */ diff --git a/hw/xwin/winerror.c b/hw/xwin/winerror.c index 9ed27c3d0..191b9a921 100644 --- a/hw/xwin/winerror.c +++ b/hw/xwin/winerror.c @@ -41,8 +41,9 @@ /* References to external symbols */ extern char * g_pszCommandLine; -extern char * g_pszLogFile; +extern const char * g_pszLogFile; extern Bool g_fSilentFatalError; +extern Bool g_fLogInited; #ifdef DDXOSVERRORF @@ -87,6 +88,12 @@ OsVendorFatalError (void) if (g_fSilentFatalError) return; + if (!g_fLogInited) { + g_fLogInited = TRUE; + g_pszLogFile = LogInit (g_pszLogFile, NULL); + } + LogClose (); + winMessageBoxF ( "A fatal error has occurred and " PROJECT_NAME " will now exit.\n" \ "Please open %s for more information.\n", diff --git a/hw/xwin/winglobals.c b/hw/xwin/winglobals.c index 7bb4a602d..926ce69b8 100644 --- a/hw/xwin/winglobals.c +++ b/hw/xwin/winglobals.c @@ -69,9 +69,9 @@ Bool g_fAuthEnabled = FALSE; HICON g_hIconX = NULL; HICON g_hSmallIconX = NULL; #ifndef RELOCATE_PROJECTROOT -char * g_pszLogFile = "/tmp/XWin.log"; +const char * g_pszLogFile = DEFAULT_LOGDIR "/XWin.%s.log"; #else -char * g_pszLogFile = "XWin.log"; +const char * g_pszLogFile = "XWin.log"; Bool g_fLogFileChanged = FALSE; #endif int g_iLogVerbose = 2; diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c index 159e53333..66da76f6c 100755 --- a/hw/xwin/winprocarg.c +++ b/hw/xwin/winprocarg.c @@ -53,7 +53,7 @@ extern Bool g_fUnicodeClipboard; extern Bool g_fClipboard; #endif extern int g_iLogVerbose; -extern char * g_pszLogFile; +extern const char * g_pszLogFile; #ifdef RELOCATE_PROJECTROOT extern Bool g_fLogFileChanged; #endif diff --git a/hw/xwin/winshaddd.c b/hw/xwin/winshaddd.c index 4f3e89501..85dc10f53 100644 --- a/hw/xwin/winshaddd.c +++ b/hw/xwin/winshaddd.c @@ -42,7 +42,7 @@ */ extern HWND g_hDlgExit; -extern char *g_pszLogFile; +extern const char *g_pszLogFile; /* * FIXME: Headers are broken, DEFINE_GUID doesn't work correctly, diff --git a/include/xwin-config.h.in b/include/xwin-config.h.in index 21ceb29cf..13b51ca7f 100644 --- a/include/xwin-config.h.in +++ b/include/xwin-config.h.in @@ -32,3 +32,5 @@ /* Location of system.XWinrc */ #undef SYSCONFDIR +/* Default log location */ +#undef DEFAULT_LOGDIR |