From 18ad9f5070b6ca49d00638a62f32dda2ffc3b369 Mon Sep 17 00:00:00 2001 From: keramida Date: Sat, 10 Jul 2010 11:40:31 +0000 Subject: [PATCH] Fix reading of empty fifolog files. When we don't have anything to inflate, skip the rest of the fifolog reader code to avoid hitting the assert about Z_OK a bit further down. Approved by: phk MFC after: 1 week --- usr.sbin/fifolog/lib/fifolog_reader.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.sbin/fifolog/lib/fifolog_reader.c b/usr.sbin/fifolog/lib/fifolog_reader.c index 6f18fbb90052..d7475ed7f799 100644 --- a/usr.sbin/fifolog/lib/fifolog_reader.c +++ b/usr.sbin/fifolog/lib/fifolog_reader.c @@ -304,8 +304,10 @@ fifolog_reader_process(struct fifolog_reader *fr, off_t from, fifolog_reader_ren if (i == Z_STREAM_END) { i = inflateReset(zs); } - if (i != Z_OK) + if (i != Z_OK) { fprintf(stderr, "inflate = %d\n", i); + exit (250); + } assert(i == Z_OK); if (zs->avail_out != fr->olen) { q = fr->obuf + (fr->olen - zs->avail_out);