Hi,

I will push the patch if no comment by end of today.

Best Regards,
ThuanTr

-----Original Message-----
From: thuan.tran <[email protected]> 
Sent: Tuesday, December 17, 2019 10:49 AM
To: Minh Hon Chau <[email protected]>; thuan . tran 
<[email protected]>; thang . d . nguyen
<[email protected]>; [email protected]
Cc: [email protected]
Subject: [PATCH 1/1] mds: update mdstest 27 4 to use waitpid() [#3130]

Wait() may stuck forever if other receiver already exited before.
---
 src/mds/apitest/mdstipc_api.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/mds/apitest/mdstipc_api.c b/src/mds/apitest/mdstipc_api.c
index 4a97f99e9..1f16a6a93 100644
--- a/src/mds/apitest/mdstipc_api.c
+++ b/src/mds/apitest/mdstipc_api.c
@@ -13612,10 +13612,13 @@ void tet_overload_tp_4(void)
                                                1, fr_svcids);
                        mds_shutdown();
                        if (FAIL == 0) {
+                               pid_t rc;
                                int status;
-                               wait(&status);
-                               if (WIFEXITED(status) && \
-                                       (WEXITSTATUS(status) != 0)) {
+                               do {
+                                       rc = waitpid(pid2, &status, 0);
+                               } while ((rc == -1) && (errno == EINTR));
+                               if ((rc == -1) || \
+                                   (WIFEXITED(status) && (WEXITSTATUS(status) 
!= 0))) {
                                        printf("\nThe other receiver FAIL\n");
                                        FAIL = 1;
                                }
-- 
2.17.1




_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to