diff options
Diffstat (limited to 'tools/perf/builtin-stat.c')
-rw-r--r-- | tools/perf/builtin-stat.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 1410d66192f7..63a3afc7f32b 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c | |||
@@ -561,7 +561,8 @@ try_again: | |||
561 | break; | 561 | break; |
562 | } | 562 | } |
563 | } | 563 | } |
564 | wait4(child_pid, &status, 0, &stat_config.ru_data); | 564 | if (child_pid != -1) |
565 | wait4(child_pid, &status, 0, &stat_config.ru_data); | ||
565 | 566 | ||
566 | if (workload_exec_errno) { | 567 | if (workload_exec_errno) { |
567 | const char *emsg = str_error_r(workload_exec_errno, msg, sizeof(msg)); | 568 | const char *emsg = str_error_r(workload_exec_errno, msg, sizeof(msg)); |