From: Tobias Oetiker Date: Mon, 29 Sep 2008 20:00:34 +0000 (+0000) Subject: This bug caused the last line in each journal file to be processed a X-Git-Tag: 1.4.0~294 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec98dd8b2b0658ad3454cf960a1f8c8111bfe729;p=thirdparty%2Frrdtool-1.x.git This bug caused the last line in each journal file to be processed a second time. Since it had been modified due to tokenizing, it failed syntax check. The daemon would always record one failed line at end-of-journal as a result. No data loss incurred by this bug. -- kevin git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1548 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/src/rrd_daemon.c b/src/rrd_daemon.c index abcb7883..ead969b4 100644 --- a/src/rrd_daemon.c +++ b/src/rrd_daemon.c @@ -1508,7 +1508,8 @@ static int journal_replay (const char *file) /* {{{ */ size_t entry_len; ++line; - fgets(entry, sizeof(entry), fh); + if (fgets(entry, sizeof(entry), fh) == NULL) + break; entry_len = strlen(entry); /* check \n termination in case journal writing crashed mid-line */