Moved signal()

This commit is contained in:
Nate Choe
2022-02-15 16:45:16 -06:00
parent ce6bc14fa5
commit 8d1650299a
2 changed files with 3 additions and 3 deletions

View File

@@ -21,6 +21,7 @@
#include <pwd.h> #include <pwd.h>
#include <fcntl.h> #include <fcntl.h>
#include <signal.h>
#include <unistd.h> #include <unistd.h>
#include <pthread.h> #include <pthread.h>
@@ -190,6 +191,8 @@ NULL
} }
} }
signal(SIGPIPE, SIG_IGN);
pending = calloc(processes - 1, sizeof(int)); pending = calloc(processes - 1, sizeof(int));
notify = malloc(sizeof(int[2]) * (processes - 1)); notify = malloc(sizeof(int[2]) * (processes - 1));
threads = malloc(sizeof(pthread_t) * (processes - 1)); threads = malloc(sizeof(pthread_t) * (processes - 1));

View File

@@ -20,7 +20,6 @@
#include <assert.h> #include <assert.h>
#include <poll.h> #include <poll.h>
#include <signal.h>
#include <unistd.h> #include <unistd.h>
#include <swebs/runner.h> #include <swebs/runner.h>
@@ -43,8 +42,6 @@ void *runServer(RunnerArgs *args) {
fds[0].fd = notify; fds[0].fd = notify;
fds[0].events = POLLIN; fds[0].events = POLLIN;
signal(SIGPIPE, SIG_IGN);
for (;;) { for (;;) {
int i; int i;
poll(fds, connCount, site->timeout); poll(fds, connCount, site->timeout);