summaryrefslogtreecommitdiff
path: root/os/error.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/error.c')
-rw-r--r--os/error.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/os/error.c b/os/error.c
index 3d21b10..8c72a65 100644
--- a/os/error.c
+++ b/os/error.c
@@ -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);
}
}