From: Jens Axboe Date: Thu, 2 Feb 2006 08:23:56 +0000 (+0100) Subject: [PATCH] blktrace: make write_data() return early with buflen == 0 X-Git-Tag: blktrace-0.99.1~85 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=6480258ab0432d3a09ef884d4cc49e11f8c3ccee;p=blktrace.git [PATCH] blktrace: make write_data() return early with buflen == 0 --- diff --git a/blktrace.c b/blktrace.c index 024675b..8601194 100644 --- a/blktrace.c +++ b/blktrace.c @@ -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)