Mercurial > repos > rhope
diff runtime/net.c @ 165:47ab97730865
Fix a couple of issues in networking lib
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 10 Mar 2011 04:15:37 +0000 |
parents | e9a8269384bb |
children |
line wrap: on
line diff
--- a/runtime/net.c Fri Jan 07 03:19:26 2011 -0500 +++ b/runtime/net.c Thu Mar 10 04:15:37 2011 +0000 @@ -4,6 +4,7 @@ #include <netinet/in.h> #include <string.h> #include <stdio.h> +#include <signal.h> int _internal_accept(int sockfd, char * addrbuf, int buflen) { @@ -88,3 +89,11 @@ return sock; } +int _internal_ignoresigpipe() +{ + struct sigaction act; + memset(&act, 0, sizeof(act)); + act.sa_handler = SIG_IGN; + return sigaction(SIGPIPE, &act, NULL); +} +