linux-btrace.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/10] Check setvbuf return value
@ 2011-12-16 19:05 Eric Sandeen
  0 siblings, 0 replies; only message in thread
From: Eric Sandeen @ 2011-12-16 19:05 UTC (permalink / raw)
  To: linux-btrace

Check for setvbuf failure.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/blktrace.c b/blktrace.c
index 72866e2..848250d 100644
--- a/blktrace.c
+++ b/blktrace.c
@@ -2178,7 +2178,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;



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-12-16 19:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-16 19:05 [PATCH 1/10] Check setvbuf return value Eric Sandeen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).