static volatile pid_t pid_to_wait_for;
static int pid_to_wait_for_status;
-static void sigchld_handler() {
+static void sigchld_handler(int signal) {
int status;
pid_t pid;
+ (void)signal;
+
while ((pid = waitpid(-1, &status, WNOHANG)) > 0) {
if (pid == pid_to_wait_for) {
/* Mark that our child has died and we should exit as well. */
struct sigaction action = {
.sa_handler = sigchld_handler,
};
+ sigemptyset(&action.sa_mask);
if (sigaction(SIGCHLD, &action, NULL) != 0) {
die("sigaction");
}