[PATCH] blktrace: remember to check flush_subbuf() return value
authorJens Axboe <axboe@suse.de>
Tue, 14 Mar 2006 13:15:33 +0000 (14:15 +0100)
committerJens Axboe <axboe@suse.de>
Tue, 14 Mar 2006 13:15:33 +0000 (14:15 +0100)
Also label 'maxlen' as unused instead of using casting tricks.

blktrace.c

index 5c8377b6878f87efbec1845a6f92713fd0730964..1304ced7d63b1b946c784a24617240816bbfbcff 100644 (file)
@@ -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;
 }