diff options
author | Luke Bratch <luke@bratch.co.uk> | 2023-03-21 23:41:16 +0000 |
---|---|---|
committer | Luke Bratch <luke@bratch.co.uk> | 2023-03-21 23:41:16 +0000 |
commit | 7d12838e4c4d97cdd2757a8a7e00df41098e9a73 (patch) | |
tree | 6e040ce14ca78e5e4e1e43d88d495d64be896b0a | |
parent | d59eee14433a851607281b847de11cc6c2233cff (diff) |
Don't try to close log file if the pointer was NULL.
-rw-r--r-- | TODO | 6 | ||||
-rw-r--r-- | config.c | 4 | ||||
-rw-r--r-- | logging.c | 1 |
3 files changed, 7 insertions, 4 deletions
@@ -2,7 +2,7 @@ All the TODOs sprinkled throughout the code! Configurable rotation of replay and debug logs. -Automatic rotation of replay log along with debug log? +Automatic rotation of replay log along with debug log? Especially given that replay from before startup is not sent. Configurable timestamp format in logs. @@ -43,4 +43,8 @@ Connecting from irssi triggers doautoreplay() from "USER received" in message.c Use the line number based replay log reading method from lastspoke rather than the inefficient re-read + line offset method in time replays? (And potentially remove a bunch of code re-use.) +What happens with lastspoke when there was no lastspoke time? Potentially opt to fall back on time based. And/or add lastspoke + time? + Crash when requesting 30 hour replay. + +Crash efnet 21/03/2023 20:32:25, possibly on sendtoserver() after a series of trying/failing to reconnect to disconnceted/timed-out server (no socket fd?). @@ -100,7 +100,7 @@ int getconfstr(char *confname, char *filename, char* dest) { debugprint(DEBUG_FULL, "getconfstr(): returning '%s'.\n", dest); - // Close fine and return success + // Close file and return success fclose(fp); return 1; } @@ -201,7 +201,7 @@ int getconfarr(char *confname, char *filename, char dest[MAXCONFARR][MAXDATASIZE debugprint(DEBUG_FULL, "getconfarr(): returning '%s'.\n", dest[i]); } - // Close fine and return success (or 0 if no values found in an otherwise valid array) + // Close file and return success (or 0 if no values found in an otherwise valid array) fclose(fp); if (valuecount) { return 1; @@ -341,7 +341,6 @@ int logline(char *str, struct ircdstate *ircdstate, char *basedir, int type) { if (fp == NULL) { debugprint(DEBUG_CRIT, "error: could not open log file '%s' for writing.\n", filename); printf("error: could not open log file '%s' for writing.\n", filename); - fclose(fp); return 0; } |