Fix a mistake in r287292. Despite correctly stating intent in the

comment above, POSIX_SPAWN_SETSIGMASK and POSIX_SPAWN_SETSIGDEF
handlers used libthr interposed functions instead of syscalls.

Noted by:	jilles
Sponsored by:	The FreeBSD Foundation
MFC after:	6 days
This commit is contained in:
kib 2015-08-30 04:46:44 +00:00
parent 47741465e9
commit 8d79bfab26

View File

@ -123,13 +123,13 @@ process_spawnattr(const posix_spawnattr_t sa)
* Use unwrapped syscall, libthr is in undefined state after vfork().
*/
if (sa->sa_flags & POSIX_SPAWN_SETSIGMASK) {
__libc_sigprocmask(SIG_SETMASK, &sa->sa_sigmask, NULL);
__sys_sigprocmask(SIG_SETMASK, &sa->sa_sigmask, NULL);
}
if (sa->sa_flags & POSIX_SPAWN_SETSIGDEF) {
for (i = 1; i <= _SIG_MAXSIG; i++) {
if (sigismember(&sa->sa_sigdefault, i))
if (__libc_sigaction(i, &sigact, NULL) != 0)
if (__sys_sigaction(i, &sigact, NULL) != 0)
return (errno);
}
}