osperf/osperf: move close pipefd after pthread_join

Avoid the new thread write the closed pipe

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
This commit is contained in:
Bowen Wang 2024-06-05 10:24:15 +08:00 committed by Xiang Xiao
parent f15ed311c0
commit 6ea8f70ca8

View file

@ -281,9 +281,9 @@ static size_t poll_performance(void)
poll(&fds, 1, -1);
performance_end(&result);
pthread_join(ret, NULL);
close(pipefd[0]);
close(pipefd[1]);
pthread_join(ret, NULL);
return performance_gettime(&result);
}