1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

Complain only once with autologging if opening some log file failed

(locked by another irssi)


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@734 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-10-13 21:53:25 +00:00 committed by cras
parent 0ef25c9fb4
commit 28f3e476da
3 changed files with 5 additions and 1 deletions

View File

@ -88,6 +88,7 @@ int log_start_logging(LOG_REC *log)
log_file_create_mode); log_file_create_mode);
if (log->handle == -1) { if (log->handle == -1) {
signal_emit("log create failed", 1, log); signal_emit("log create failed", 1, log);
log->failed = TRUE;
return FALSE; return FALSE;
} }
#ifdef HAVE_FCNTL #ifdef HAVE_FCNTL
@ -97,6 +98,7 @@ int log_start_logging(LOG_REC *log)
close(log->handle); close(log->handle);
log->handle = -1; log->handle = -1;
signal_emit("log locked", 1, log); signal_emit("log locked", 1, log);
log->failed = TRUE;
return FALSE; return FALSE;
} }
#endif #endif
@ -108,6 +110,7 @@ int log_start_logging(LOG_REC *log)
"\n", log->last); "\n", log->last);
signal_emit("log started", 1, log); signal_emit("log started", 1, log);
log->failed = FALSE;
return TRUE; return TRUE;
} }

View File

@ -13,6 +13,7 @@ typedef struct {
time_t last; /* when last message was written */ time_t last; /* when last message was written */
int autoopen:1; /* automatically start logging at startup */ 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 */ int temp:1; /* don't save this to config file */
} LOG_REC; } LOG_REC;

View File

@ -295,7 +295,7 @@ static void autolog_log(void *server, const char *target)
char *fname, *dir, *str; char *fname, *dir, *str;
log = log_find_item(target); log = log_find_item(target);
if (log != NULL) { if (log != NULL && !log->failed) {
log_start_logging(log); log_start_logging(log);
return; return;
} }