summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2023-03-21 23:41:16 +0000
committerLuke Bratch <luke@bratch.co.uk>2023-03-21 23:41:16 +0000
commit7d12838e4c4d97cdd2757a8a7e00df41098e9a73 (patch)
tree6e040ce14ca78e5e4e1e43d88d495d64be896b0a
parentd59eee14433a851607281b847de11cc6c2233cff (diff)
Don't try to close log file if the pointer was NULL.
-rw-r--r--TODO6
-rw-r--r--config.c4
-rw-r--r--logging.c1
3 files changed, 7 insertions, 4 deletions
diff --git a/TODO b/TODO
index 6b83957..ebbd5d4 100644
--- a/TODO
+++ b/TODO
@@ -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?).
diff --git a/config.c b/config.c
index 483f88e..2ee47f5 100644
--- a/config.c
+++ b/config.c
@@ -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;
diff --git a/logging.c b/logging.c
index a3eac5b..d0ad1a5 100644
--- a/logging.c
+++ b/logging.c
@@ -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;
}