[LTP] [PATCH V2 06/11] syscalls/waitpid: make reap_children() fail if errno is not ECHILD
Stanislav Kholmanskikh
stanislav.kholmanskikh@oracle.com
Wed Aug 24 14:27:54 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>
---
No changes since V1.
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 f5e9519..f724a17 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