diff --git a/kernel_lite/ipc_posix/semaphore/SemTest.cpp b/kernel_lite/ipc_posix/semaphore/SemTest.cpp index 91883c39fb13c58f7ef6317a21c6116640be04aa..c9bdeeb38f4c5cf65d5aa9a991c202b4059e3b89 100755 --- a/kernel_lite/ipc_posix/semaphore/SemTest.cpp +++ b/kernel_lite/ipc_posix/semaphore/SemTest.cpp @@ -257,7 +257,15 @@ HWTEST_F(SemTest, testThreadSemTryWait, Function | MediumTest | Level3) reInt = pthread_join(tid, nullptr); EXPECT_EQ(sem_getvalue(&sem, &semValue), 0) << "> sem_getvalue errno = " << errno; - EXPECT_EQ(semValue, 1); + + if (semValue == 1 || semValue == 2) { + EXPECT_TRUE(true); + LOG("semValue = %d", semValue); + } else { + EXPECT_TRUE(false); + LOG("semValue errno, semValue = %d", semValue); + } + EXPECT_EQ(reInt, 0) << "pthread_join failed, errno=" << reInt; EXPECT_EQ(sem_destroy(&sem), 0) << "> sem_destroy errno = " << errno; } diff --git a/kernel_lite/ipc_posix/shared_memory/ShmTest.cpp b/kernel_lite/ipc_posix/shared_memory/ShmTest.cpp index 8f6b08fb73adc80e7598cc728722574495737359..6d3aaf3b2d37579670f40d7d333d1af4d838c895 100755 --- a/kernel_lite/ipc_posix/shared_memory/ShmTest.cpp +++ b/kernel_lite/ipc_posix/shared_memory/ShmTest.cpp @@ -227,10 +227,10 @@ HWTEST_F(ShmTest, testShmatSHM_REMAP, Function | MediumTest | Level1) strncpy(shared, SHM_TEST_STR, SHM_TEST_STR_LEN); ASSERT_NE(shmdt(shared), -1) << "> parent: shmdt 2 : errno = " << errno; Msleep(50); - ASSERT_NE(shmctl(shmid, IPC_RMID, nullptr), -1) << "> parent: shmctl : errno = " << errno; + WaitProcExitedOK(pid); Msleep(50); - WaitProcExitedOK(pid); + ASSERT_NE(shmctl(shmid, IPC_RMID, nullptr), -1) << "> parent: shmctl : errno = " << errno; } /** diff --git a/kernel_lite/utils/utils.cpp b/kernel_lite/utils/utils.cpp index be602c7adbf9a5ab25bcb0a6115cef3b0fa3c858..9a013fc5b937dcb133e06aed2e6291be1faa8818 100644 --- a/kernel_lite/utils/utils.cpp +++ b/kernel_lite/utils/utils.cpp @@ -127,10 +127,13 @@ int RunElf(const char *fname, char * const argv[], char * const envp[], int time { int isTimeout = 0; int exitCode; - sigset_t set; + sigset_t set, orig_mask; sigemptyset(&set); sigaddset(&set, SIGCHLD); - + + if (sigprocmask(SIG_BLOCK, &set, &orig_mask) < 0) { + LOG("sigprocmask"); + } int pid = StartElf(fname, argv, envp); if (pid == -1) { // fork error return -1;