All of lore.kernel.org
 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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.