diff options
author | Johnny Richard <johnny@johnnyrichard.com> | 2022-04-09 02:09:43 +0200 |
---|---|---|
committer | Johnny Richard <johnny@johnnyrichard.com> | 2022-04-09 02:09:43 +0200 |
commit | 428c7a6cd55a8b05766be1b04cde824d1ea190de (patch) | |
tree | a2ebdf3eb74bc859089ae9aee08f68b8a0d2b3df | |
parent | ffc7c41f936abbe5c8baac129a3c21a277d29933 (diff) |
Avoid program die on SIGPIPE signal
-rw-r--r-- | main.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -16,12 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ #include <stdlib.h> +#include <signal.h> #include "server.h" #define SERVER_PORT 6667 int main() { + sigaction(SIGPIPE, &(struct sigaction){SIG_IGN}, NULL); + server_t server = server_create(SERVER_PORT); server_listen(&server); |