MCPcopy Create free account
hub / github.com/git/git / check_dead_children

Function check_dead_children

daemon.c:860–880  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

858}
859
860static void check_dead_children(void)
861{
862 int status;
863 pid_t pid;
864
865 struct child **cradle, *blanket;
866 for (cradle = &firstborn; (blanket = *cradle);)
867 if ((pid = waitpid(blanket->cld.pid, &status, WNOHANG)) > 1) {
868 const char *dead = "";
869 if (status)
870 dead = " (with error)";
871 loginfo("[%"PRIuMAX"] Disconnected%s", (uintmax_t)pid, dead);
872
873 /* remove the child */
874 *cradle = blanket->next;
875 live_children--;
876 child_process_clear(&blanket->cld);
877 free(blanket);
878 } else
879 cradle = &blanket->next;
880}
881
882static struct strvec cld_argv = STRVEC_INIT;
883static void handle(int incoming, struct sockaddr *addr, socklen_t addrlen)

Callers 2

handleFunction · 0.85
service_loopFunction · 0.85

Calls 3

waitpidFunction · 0.85
loginfoFunction · 0.85
child_process_clearFunction · 0.85

Tested by

no test coverage detected