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
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to