File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
tools/testing/selftests/nolibc Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1323,7 +1323,8 @@ static int run_protection(int min __attribute__((unused)),
1323
1323
int max __attribute__((unused )))
1324
1324
{
1325
1325
pid_t pid ;
1326
- int llen = 0 , status ;
1326
+ int llen = 0 , ret ;
1327
+ siginfo_t siginfo = {};
1327
1328
struct rlimit rlimit = { 0 , 0 };
1328
1329
1329
1330
llen += printf ("0 -fstackprotector " );
@@ -1361,10 +1362,11 @@ static int run_protection(int min __attribute__((unused)),
1361
1362
return 1 ;
1362
1363
1363
1364
default :
1364
- pid = waitpid ( pid , & status , 0 );
1365
+ ret = waitid ( P_PID , pid , & siginfo , WEXITED );
1365
1366
1366
- if (pid == -1 || !WIFSIGNALED (status ) || WTERMSIG (status ) != SIGABRT ) {
1367
- llen += printf ("waitpid()" );
1367
+ if (ret != 0 || siginfo .si_signo != SIGCHLD ||
1368
+ siginfo .si_code != CLD_KILLED || siginfo .si_status != SIGABRT ) {
1369
+ llen += printf ("waitid()" );
1368
1370
result (llen , FAIL );
1369
1371
return 1 ;
1370
1372
}
You can’t perform that action at this time.
0 commit comments