[PATCH] blktrace: make write_data() return early with buflen == 0
authorJens Axboe <axboe@suse.de>
Thu, 2 Feb 2006 08:23:56 +0000 (09:23 +0100)
committerJens Axboe <axboe@suse.de>
Thu, 2 Feb 2006 08:23:56 +0000 (09:23 +0100)
blktrace.c

index 024675b7b457ca22f378a80f44eaf37742ba562b..8601194586bcef68c64383dc23376b41eb6db96f 100644 (file)
@@ -407,6 +407,9 @@ static int write_data(struct thread_information *tip,
 {
        int ret;
 
+       if (!buf_len)
+               return 0;
+
        while (1) {
                ret = fwrite(buf, buf_len, 1, tip->ofile);
                if (ret == 1)