[LTP] [PATCH 4/8] syscalls/waitpid: make reap_children() fail if errno is not ECHILD

Stanislav Kholmanskikh stanislav.kholmanskikh@oracle.com
Wed Aug 10 10:41:02 CEST 2016


We expect that waitpid() may fail only with EINTR or ECHILD.
All other errno values signal about an error.

Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
---
 testcases/kernel/syscalls/waitpid/waitpid_common.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/testcases/kernel/syscalls/waitpid/waitpid_common.h b/testcases/kernel/syscalls/waitpid/waitpid_common.h
index df0de9b..a2eb508 100644
--- a/testcases/kernel/syscalls/waitpid/waitpid_common.h
+++ b/testcases/kernel/syscalls/waitpid/waitpid_common.h
@@ -117,6 +117,9 @@ static int reap_children(pid_t wp_pid, int wp_opts, pid_t *children, int len)
 			if (errno == EINTR)
 				continue;
 
+			if (waitpid_errno_check(errno, ECHILD))
+				return -1;
+
 			break;
 		}
 
-- 
1.7.1



More information about the ltp mailing list