[igt-dev] [PATCH] lib/igt_aux: do not complain about dead processes

Andrzej Hajda andrzej.hajda at intel.com
Thu Jul 14 14:38:05 UTC 2022


During process lookup some processes can be dead already, in such case
opendir(proc_path) can fail with ENOENT. It is fine, we do not need to
abort test.

Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6042
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6054
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6361
Signed-off-by: Andrzej Hajda <andrzej.hajda at intel.com>
---
 lib/igt_aux.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/igt_aux.c b/lib/igt_aux.c
index 35c67f103ba..b37bae87860 100644
--- a/lib/igt_aux.c
+++ b/lib/igt_aux.c
@@ -1664,6 +1664,8 @@ __igt_lsof_audio_and_kill_proc(proc_t *proc_info, char *proc_path)
 		return 0;
 
 	dp = opendir(proc_path);
+	if (!dp && errno == ENOENT)
+		return 0;
 	igt_assert(dp);
 
 	while ((d = readdir(dp))) {
-- 
2.25.1



More information about the igt-dev mailing list