Fix boundschecking fork for macos/SELINUX

lib/bcheck.c:
- Use INIT_SEM for child process fork on macos

tests/tests2/Makefile:
- tcc -run does not work for fork due to SHARED mmap
This commit is contained in:
herman ten brugge 2020-09-14 19:31:56 +02:00
parent 61c0c852b5
commit d55e586bc6
2 changed files with 5 additions and 1 deletions

View File

@ -1376,7 +1376,10 @@ pid_t fork(void)
WAIT_SEM();
retval = (*fork_redir)();
POST_SEM();
if (retval == 0)
INIT_SEM();
else
POST_SEM();
return retval;
}
#endif

View File

@ -94,6 +94,7 @@ GEN-ALWAYS =
./a.exe
114_bound_signal.test: FLAGS += -b
114_bound_signal.test: NORUN = true # tcc -run does not support fork and -b and SELINUX
115_bound_setjmp.test: FLAGS += -b
116_bound_setjmp2.test: FLAGS += -b
117_builtins.test: T1 = ( $(TCC) -run $1 && $(TCC) -b -run $1 )