use correct facility in LOG messages
This commit is contained in:
parent
a06a5f1baa
commit
c08e7e716d
3 changed files with 7 additions and 7 deletions
|
@ -249,7 +249,7 @@ LOG_FileWrite(LOG_FileID id, const char *format, ...)
|
||||||
if (snprintf(filename, sizeof(filename), "%s/%s.log",
|
if (snprintf(filename, sizeof(filename), "%s/%s.log",
|
||||||
logdir, logfiles[id].name) >= sizeof (filename) ||
|
logdir, logfiles[id].name) >= sizeof (filename) ||
|
||||||
!(logfiles[id].file = fopen(filename, "a"))) {
|
!(logfiles[id].file = fopen(filename, "a"))) {
|
||||||
LOG(LOGS_WARN, LOGF_Refclock, "Couldn't open logfile %s for update", filename);
|
LOG(LOGS_WARN, LOGF_Logging, "Could not open log file %s", filename);
|
||||||
logfiles[id].name = NULL;
|
logfiles[id].name = NULL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
8
main.c
8
main.c
|
@ -297,14 +297,14 @@ go_daemon(void)
|
||||||
/* Create pipe which will the daemon use to notify the grandparent
|
/* Create pipe which will the daemon use to notify the grandparent
|
||||||
when it's initialised or send an error message */
|
when it's initialised or send an error message */
|
||||||
if (pipe(pipefd)) {
|
if (pipe(pipefd)) {
|
||||||
LOG_FATAL(LOGF_Logging, "Could not detach, pipe failed : %s", strerror(errno));
|
LOG_FATAL(LOGF_Main, "Could not detach, pipe failed : %s", strerror(errno));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Does this preserve existing signal handlers? */
|
/* Does this preserve existing signal handlers? */
|
||||||
pid = fork();
|
pid = fork();
|
||||||
|
|
||||||
if (pid < 0) {
|
if (pid < 0) {
|
||||||
LOG_FATAL(LOGF_Logging, "Could not detach, fork failed : %s", strerror(errno));
|
LOG_FATAL(LOGF_Main, "Could not detach, fork failed : %s", strerror(errno));
|
||||||
} else if (pid > 0) {
|
} else if (pid > 0) {
|
||||||
/* In the 'grandparent' */
|
/* In the 'grandparent' */
|
||||||
char message[1024];
|
char message[1024];
|
||||||
|
@ -329,7 +329,7 @@ go_daemon(void)
|
||||||
pid = fork();
|
pid = fork();
|
||||||
|
|
||||||
if (pid < 0) {
|
if (pid < 0) {
|
||||||
LOG_FATAL(LOGF_Logging, "Could not detach, fork failed : %s", strerror(errno));
|
LOG_FATAL(LOGF_Main, "Could not detach, fork failed : %s", strerror(errno));
|
||||||
} else if (pid > 0) {
|
} else if (pid > 0) {
|
||||||
exit(0); /* In the 'parent' */
|
exit(0); /* In the 'parent' */
|
||||||
} else {
|
} else {
|
||||||
|
@ -337,7 +337,7 @@ go_daemon(void)
|
||||||
|
|
||||||
/* Change current directory to / */
|
/* Change current directory to / */
|
||||||
if (chdir("/") < 0) {
|
if (chdir("/") < 0) {
|
||||||
LOG_FATAL(LOGF_Logging, "Could not chdir to / : %s", strerror(errno));
|
LOG_FATAL(LOGF_Main, "Could not chdir to / : %s", strerror(errno));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Don't keep stdin/out/err from before. But don't close
|
/* Don't keep stdin/out/err from before. But don't close
|
||||||
|
|
|
@ -135,7 +135,7 @@ read_points(const char *filename)
|
||||||
while (fgets(line, sizeof (line), f)) {
|
while (fgets(line, sizeof (line), f)) {
|
||||||
p = (struct Point *)ARR_GetNewElement(points);
|
p = (struct Point *)ARR_GetNewElement(points);
|
||||||
if (sscanf(line, "%lf %lf", &p->temp, &p->comp) != 2) {
|
if (sscanf(line, "%lf %lf", &p->temp, &p->comp) != 2) {
|
||||||
LOG_FATAL(LOGF_Configure, "Could not read tempcomp point from %s", filename);
|
LOG_FATAL(LOGF_TempComp, "Could not read tempcomp point from %s", filename);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -143,7 +143,7 @@ read_points(const char *filename)
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
if (ARR_GetSize(points) < 2)
|
if (ARR_GetSize(points) < 2)
|
||||||
LOG_FATAL(LOGF_Configure, "Not enough points in %s", filename);
|
LOG_FATAL(LOGF_TempComp, "Not enough points in %s", filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in a new issue