diff options
Diffstat (limited to 'pr/src/io/prlog.c')
-rw-r--r-- | pr/src/io/prlog.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pr/src/io/prlog.c b/pr/src/io/prlog.c index 16f68823..334fddcc 100644 --- a/pr/src/io/prlog.c +++ b/pr/src/io/prlog.c @@ -277,11 +277,16 @@ void _PR_LogCleanup(void) while (lm != NULL) { PRLogModuleInfo *next = lm->next; - PR_Free((/*const*/ char *)lm->name); + free((/*const*/ char *)lm->name); PR_Free(lm); lm = next; } logModules = NULL; + + if (_pr_logLock) { + PR_DestroyLock(_pr_logLock); + _pr_logLock = NULL; + } } static void _PR_SetLogModuleLevel( PRLogModuleInfo *lm ) @@ -361,7 +366,7 @@ PR_IMPLEMENT(PRBool) PR_SetLogFile(const char *file) #else PRFileDesc *newLogFile; - newLogFile = PR_Open(file, PR_WRONLY|PR_CREATE_FILE, 0666); + newLogFile = PR_Open(file, PR_WRONLY|PR_CREATE_FILE|PR_TRUNCATE, 0666); if (newLogFile) { if (logFile && logFile != _pr_stdout && logFile != _pr_stderr) { PR_Close(logFile); |