<commit_before>#include <stdlib.h>
#include <stdio.h>
#include <sys/signal.h>
#include <unistd.h>

void test_handler(int signo) 
{
    fprintf(stderr, "caught signo: %d\n", signo);
}


int main(void) 
{
    int count = 0;
    struct sigaction siga;
    static sigset_t sigset;

    sigfillset(&sigset);

    siga.sa_handler = test_handler;
    siga.sa_mask = sigset;
    siga.sa_flags = 0;

    if (0 != sigaction(SIGCHLD, &siga, (struct sigaction *)NULL)) {
	fprintf(stderr, "ack!");
    }
    printf("give me a SIGCHLD\n");

    for(;;) {
	sleep(10);
	printf("after sleep %d\n", ++count);
    }

    printf("after loop\n");

    return 0;
}
<commit_msg>Cleaned up test that doesn't need manual intervention.  -Erik<commit_after>#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <stdio.h>
#include <sys/signal.h>
#include <sys/wait.h>
#include <unistd.h>


void test_handler(int signo) 
{
    printf("caught signo: %d\n", signo);
    fflush(stdout);
}


int main(void) 
{
    pid_t mypid;
    int count = 0;
    struct sigaction siga;
    static sigset_t sigset;

    mypid = getpid();

    if (fork() == 0) {
	int i;

	for (i=0; i < 3; i++) {
	    sleep(2);
	    kill(mypid, SIGCHLD);
	}
	exit(EXIT_SUCCESS);
    }

    sigfillset(&sigset);

    siga.sa_handler = test_handler;
    siga.sa_mask = sigset;
    siga.sa_flags = 0;

    if (sigaction(SIGCHLD, &siga, (struct sigaction *)NULL) != 0) {
	fprintf(stderr, "sigaction choked: %s!", strerror(errno));
	exit(EXIT_FAILURE);
    }
    printf("waiting for a SIGCHLD\n");
    fflush(stdout);

    for(;;) {
	sleep(10);
	if (waitpid(-1, NULL, WNOHANG | WUNTRACED) > 0)
	    break;
	printf("after sleep %d\n", ++count);
	fflush(stdout);
    }

    printf("after loop\n");

    return 0;
}

{'fraction_non_alphanumeric': 0.16609783845278725, 'fraction_numerical': 0.010238907849829351, 'mean_word_length': 3.1388235294117646, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1641648', 'n_tokens_mistral': 741, 'n_tokens_neox': 706, 'n_words': 159}