summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu.herrb@laas.fr>2004-07-26 22:44:25 +0000
committerMatthieu Herrb <matthieu.herrb@laas.fr>2004-07-26 22:44:25 +0000
commit9971dd3529c07022231fd722cb593f6609dd9d70 (patch)
treed65bea9a4e415d94bcc6204526c48d9e10577521
parent956b25ecaa203291b5abdfc43451ae34da4ebdc7 (diff)
Safiullin and Mike Pechkin.
-rw-r--r--difs/main.c2
-rw-r--r--os/error.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/difs/main.c b/difs/main.c
index b7d8a4c..370005e 100644
--- a/difs/main.c
+++ b/difs/main.c
@@ -95,7 +95,6 @@ main(int argc, char *argv[])
/* init stuff */
ProcessCmdLine(argc, argv);
- InitErrors();
/*
* Do this first thing, to get any options that only take effect at
@@ -104,6 +103,7 @@ main(int argc, char *argv[])
if (ReadConfigFile(configfilename) != FSSuccess) {
FatalError("couldn't read config file\n");
}
+ InitErrors();
/* make sure at least world write access is disabled */
if (((oldumask = umask(022)) & 002) == 002)
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);
}
}