Make examples folder somewhat more focused

This commit is contained in:
Justine Tunney 2021-03-05 06:09:12 -08:00
parent 5141d00992
commit e26bdbec52
29 changed files with 133 additions and 1225 deletions

View file

@ -32,9 +32,9 @@ int main(int argc, char *argv[]) {
ssize_t rc;
size_t got, wrote;
unsigned char buf[512];
struct sigaction saint = {.sa_handler = GotCtrlC};
fprintf(stderr, "This echos stdio until Ctrl+C is pressed.\n");
CHECK_NE(
-1, sigaction(SIGINT, &(struct sigaction){.sa_handler = GotCtrlC}, NULL));
CHECK_NE(-1, sigaction(SIGINT, &saint, NULL));
for (;;) {
rc = read(0, buf, BUFSIZ);
if (rc != -1) {