summaryrefslogtreecommitdiffstats
path: root/usr.sbin/fifolog
diff options
context:
space:
mode:
authorkeramida <keramida@FreeBSD.org>2010-07-10 11:40:31 +0000
committerkeramida <keramida@FreeBSD.org>2010-07-10 11:40:31 +0000
commit18ad9f5070b6ca49d00638a62f32dda2ffc3b369 (patch)
tree0514de30931019de13ad0dfb4f44a0924b644fcf /usr.sbin/fifolog
parent443242732ce6e0f788e3344ec79f35187e1def61 (diff)
downloadFreeBSD-src-18ad9f5070b6ca49d00638a62f32dda2ffc3b369.zip
FreeBSD-src-18ad9f5070b6ca49d00638a62f32dda2ffc3b369.tar.gz
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
Diffstat (limited to 'usr.sbin/fifolog')
-rw-r--r--usr.sbin/fifolog/lib/fifolog_reader.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/fifolog/lib/fifolog_reader.c b/usr.sbin/fifolog/lib/fifolog_reader.c
index 6f18fbb..d7475ed 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);
OpenPOWER on IntegriCloud