MCPcopy Index your code
hub / github.com/git/git / atfork_prepare

Function atfork_prepare

run-command.c:513–534  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

511 } while(0)
512
513static 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
536static void atfork_parent(struct atfork_state *as)
537{

Callers 1

start_commandFunction · 0.85

Calls 3

die_errnoFunction · 0.85
sigprocmaskFunction · 0.85
pthread_sigmaskFunction · 0.85

Tested by

no test coverage detected