if (snprintf(filename, sizeof(filename), "%s/%s.log",
logdir, logfiles[id].name) >= sizeof (filename) ||
!(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;
return;
}
/* Create pipe which will the daemon use to notify the grandparent
when it's initialised or send an error message */
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? */
pid = fork();
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) {
/* In the 'grandparent' */
char message[1024];
pid = fork();
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) {
exit(0); /* In the 'parent' */
} else {
/* Change current directory to / */
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
while (fgets(line, sizeof (line), f)) {
p = (struct Point *)ARR_GetNewElement(points);
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;
}
}
fclose(f);
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