diff options
Diffstat (limited to 'os/error.c')
-rw-r--r-- | os/error.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -86,6 +86,7 @@ Bool UseSyslog; Bool log_open = FALSE; #endif char ErrorFile[PATH_MAX]; +static char CurrentErrorFile[PATH_MAX]; static void abort_server(void) @@ -112,7 +113,7 @@ InitErrors(void) } #endif - if (ErrorFile[0]) { + if (ErrorFile[0] && strcmp(CurrentErrorFile, ErrorFile) != 0) { i = creat(ErrorFile, 0666); if (i != -1) { dup2(i, 2); @@ -120,6 +121,7 @@ InitErrors(void) } else { ErrorF("can't open error file \"%s\"\n", ErrorFile); } + strncpy(CurrentErrorFile, ErrorFile, sizeof CurrentErrorFile); } } |