aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-stat.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-stat.c')
-rw-r--r--tools/perf/builtin-stat.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 01cc07efb728..27921a8ce1a9 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -239,7 +239,8 @@ static int run_perf_stat(int argc __used, const char **argv)
239 /* 239 /*
240 * Wait until the parent tells us to go. 240 * Wait until the parent tells us to go.
241 */ 241 */
242 read(go_pipe[0], &buf, 1); 242 if (read(go_pipe[0], &buf, 1) == -1)
243 perror("unable to read pipe");
243 244
244 execvp(argv[0], (char **)argv); 245 execvp(argv[0], (char **)argv);
245 246
@@ -252,7 +253,8 @@ static int run_perf_stat(int argc __used, const char **argv)
252 */ 253 */
253 close(child_ready_pipe[1]); 254 close(child_ready_pipe[1]);
254 close(go_pipe[0]); 255 close(go_pipe[0]);
255 read(child_ready_pipe[0], &buf, 1); 256 if (read(child_ready_pipe[0], &buf, 1) == -1)
257 perror("unable to read pipe");
256 close(child_ready_pipe[0]); 258 close(child_ready_pipe[0]);
257 259
258 for (counter = 0; counter < nr_counters; counter++) 260 for (counter = 0; counter < nr_counters; counter++)