aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2011-12-16 13:05:02 -0600
committerJens Axboe <jaxboe@fusionio.com>2012-02-01 13:14:24 +0100
commitae2dc05e9084c790e773f530cefb9a1df1d51f0a (patch)
tree65ffa06561ceb5344fc374ae734da470b53aa6ae
parent7f0062f7b893a80afbe0e43f5db157c7bc1a01f9 (diff)
downloadblktrace-ae2dc05e9084c790e773f530cefb9a1df1d51f0a.tar.gz
Check setvbuf return value
Check for setvbuf failure. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
-rw-r--r--blktrace.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/blktrace.c b/blktrace.c
index b14daf2..49cfca6 100644
--- a/blktrace.c
+++ b/blktrace.c
@@ -2183,7 +2183,10 @@ static int handle_args(int argc, char *argv[])
piped_output = 1;
handle_pfds = handle_pfds_entries;
pfp = stdout;
- setvbuf(pfp, NULL, _IONBF, 0);
+ if (setvbuf(pfp, NULL, _IONBF, 0)) {
+ perror("setvbuf stdout");
+ return 1;
+ }
} else
handle_pfds = handle_pfds_file;
return 0;