| 93 | } |
| 94 | |
| 95 | static void mark_child_for_cleanup(pid_t pid, struct child_process *process) |
| 96 | { |
| 97 | struct child_to_clean *p = xmalloc(sizeof(*p)); |
| 98 | p->pid = pid; |
| 99 | p->process = process; |
| 100 | p->next = children_to_clean; |
| 101 | children_to_clean = p; |
| 102 | |
| 103 | if (!installed_child_cleanup_handler) { |
| 104 | atexit(cleanup_children_on_exit); |
| 105 | sigchain_push_common(cleanup_children_on_signal); |
| 106 | installed_child_cleanup_handler = 1; |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | static void clear_child_for_cleanup(pid_t pid) |
| 111 | { |
no test coverage detected