diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 85e992d9215bef33fa305ae197cc1d0ee97ab8ea..69523ed55894338cb202804db6ffbf202410b74f 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -707,7 +707,7 @@ static int __run_perf_stat(int argc, const char **argv) process_interval(); } } - wait(&status); + waitpid(child_pid, &status, 0); if (workload_exec_errno) { const char *emsg = str_error_r(workload_exec_errno, msg, sizeof(msg));