From d042efdfe7697e5a4e38b012f4580af3760653d9 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 14 Mar 2006 14:15:33 +0100 Subject: [PATCH] [PATCH] blktrace: remember to check flush_subbuf() return value Also label 'maxlen' as unused instead of using casting tricks. --- blktrace.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/blktrace.c b/blktrace.c index 5c8377b..1304ced 100644 --- a/blktrace.c +++ b/blktrace.c @@ -779,12 +779,11 @@ err: } static int get_subbuf_sendfile(struct thread_information *tip, - unsigned int maxlen) + __attribute__((__unused__)) unsigned int maxlen) { struct tip_subbuf *ts; struct stat sb; unsigned int ready; - (void) maxlen; wait_for_data(tip, -1); @@ -804,7 +803,8 @@ static int get_subbuf_sendfile(struct thread_information *tip, ts->len = ready; tip->data_queued += ready; - flush_subbuf_sendfile(tip, ts); + if (flush_subbuf_sendfile(tip, ts) < 0) + return -1; return ready; } -- 2.25.1