summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/log.c3
-rw-r--r--src/core/log.h1
-rw-r--r--src/fe-common/core/fe-log.c2
3 files changed, 5 insertions, 1 deletions
diff --git a/src/core/log.c b/src/core/log.c
index 92f90043..b6c6fba4 100644
--- a/src/core/log.c
+++ b/src/core/log.c
@@ -88,6 +88,7 @@ int log_start_logging(LOG_REC *log)
log_file_create_mode);
if (log->handle == -1) {
signal_emit("log create failed", 1, log);
+ log->failed = TRUE;
return FALSE;
}
#ifdef HAVE_FCNTL
@@ -97,6 +98,7 @@ int log_start_logging(LOG_REC *log)
close(log->handle);
log->handle = -1;
signal_emit("log locked", 1, log);
+ log->failed = TRUE;
return FALSE;
}
#endif
@@ -108,6 +110,7 @@ int log_start_logging(LOG_REC *log)
"\n", log->last);
signal_emit("log started", 1, log);
+ log->failed = FALSE;
return TRUE;
}
diff --git a/src/core/log.h b/src/core/log.h
index 5be51852..b8fef2ac 100644
--- a/src/core/log.h
+++ b/src/core/log.h
@@ -13,6 +13,7 @@ typedef struct {
time_t last; /* when last message was written */
int autoopen:1; /* automatically start logging at startup */
+ int failed:1; /* opening log failed last time */
int temp:1; /* don't save this to config file */
} LOG_REC;
diff --git a/src/fe-common/core/fe-log.c b/src/fe-common/core/fe-log.c
index bd1aa2cc..ccde5e1c 100644
--- a/src/fe-common/core/fe-log.c
+++ b/src/fe-common/core/fe-log.c
@@ -295,7 +295,7 @@ static void autolog_log(void *server, const char *target)
char *fname, *dir, *str;
log = log_find_item(target);
- if (log != NULL) {
+ if (log != NULL && !log->failed) {
log_start_logging(log);
return;
}