| 511 | } while(0) |
| 512 | |
| 513 | static void atfork_prepare(struct atfork_state *as) |
| 514 | { |
| 515 | sigset_t all; |
| 516 | |
| 517 | /* |
| 518 | * POSIX says sigfillset() can fail, but an overly clever |
| 519 | * compiler can see through the header files and decide |
| 520 | * it cannot fail on a particular platform it is compiling for, |
| 521 | * triggering -Wunreachable-code false positive. |
| 522 | */ |
| 523 | if (NOT_CONSTANT(sigfillset(&all))) |
| 524 | die_errno("sigfillset"); |
| 525 | #ifdef NO_PTHREADS |
| 526 | if (sigprocmask(SIG_SETMASK, &all, &as->old)) |
| 527 | die_errno("sigprocmask"); |
| 528 | #else |
| 529 | CHECK_BUG(pthread_sigmask(SIG_SETMASK, &all, &as->old), |
| 530 | "blocking all signals"); |
| 531 | CHECK_BUG(pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &as->cs), |
| 532 | "disabling cancellation"); |
| 533 | #endif |
| 534 | } |
| 535 | |
| 536 | static void atfork_parent(struct atfork_state *as) |
| 537 | { |
no test coverage detected