Mercurial > repos > rhope
comparison 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 |
comparison
equal
deleted
inserted
replaced
161:f5095855c878 | 165:47ab97730865 |
---|---|
2 #include <sys/socket.h> | 2 #include <sys/socket.h> |
3 #include <netdb.h> | 3 #include <netdb.h> |
4 #include <netinet/in.h> | 4 #include <netinet/in.h> |
5 #include <string.h> | 5 #include <string.h> |
6 #include <stdio.h> | 6 #include <stdio.h> |
7 #include <signal.h> | |
7 | 8 |
8 int _internal_accept(int sockfd, char * addrbuf, int buflen) | 9 int _internal_accept(int sockfd, char * addrbuf, int buflen) |
9 { | 10 { |
10 int retfd; | 11 int retfd; |
11 socklen_t addr_size; | 12 socklen_t addr_size; |
86 } | 87 } |
87 freeaddrinfo(res); | 88 freeaddrinfo(res); |
88 return sock; | 89 return sock; |
89 } | 90 } |
90 | 91 |
92 int _internal_ignoresigpipe() | |
93 { | |
94 struct sigaction act; | |
95 memset(&act, 0, sizeof(act)); | |
96 act.sa_handler = SIG_IGN; | |
97 return sigaction(SIGPIPE, &act, NULL); | |
98 } | |
99 |