From 50f345b10e489c3099497c10f493663fee631683 Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Wed, 29 May 2019 21:13:16 +0100 Subject: Don't exit if there's a failure to read/write from/to the replay log file. --- blabouncer.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'blabouncer.c') diff --git a/blabouncer.c b/blabouncer.c index fe8cd1e..b6dc015 100644 --- a/blabouncer.c +++ b/blabouncer.c @@ -502,8 +502,8 @@ int doreplay(int sourcefd, int replayseconds, struct client *clients, struct set debugprint("Replay log lines: '%d'.\n", numlines); if (numlines < 0) { - printf("Error getting number of replay lines.\n"); - exit(1); + debugprint("Error getting number of replay lines.\n"); + return 0; } else if (numlines == 0) { snprintf(outgoingmsg, MAXDATASIZE, "NOTICE %s :0 replay log lines found in the time requested, nothing to send.", ircdstrings->ircnick); sendtoclient(sourcefd, outgoingmsg, clients, settings, 0); @@ -517,8 +517,8 @@ int doreplay(int sourcefd, int replayseconds, struct client *clients, struct set // Replay those lines! for (int i = 0; i < numlines; i++) { if (!readreplayline(replayseconds, i, outgoingmsg, settings->basedir)) { - printf("Error requesting replay line.\n"); - exit(1); + debugprint("Error requesting replay line.\n"); + return 0; } // Check if the replay line is a TOPIC, a JOIN, or a PART so we don't @@ -538,8 +538,8 @@ int doreplay(int sourcefd, int replayseconds, struct client *clients, struct set for (int j = 0; j < 3; j++) { // Try to split if ((token = strsep(&strcopy, " ")) == NULL) { - printf("doreplay(): error splitting string on iteration %d, exiting!\n", j); - exit(1); + debugprint("doreplay(): error splitting string on iteration %d, exiting!\n", j); + return 0; } // Copy into the token array (strlen + 1 to get the NULL terminator) strncpy(tokens[j], token, strlen(token) + 1); -- cgit v1.2.3