leitner 67bfd53652 check for socket() returning -1 before trying to set the socket
non-blocking so we don't hide the "too many open files" error code
2008-09-10 09:51:26 +00:00

11 lines
198 B
C

#include <unistd.h>
#include "socket.h"
#include "ndelay.h"
int socket_tcp6(void) {
int s=socket_tcp6b();
if (s==-1) return -1;
if (ndelay_on(s) == -1) { close(s); return -1; }
return s;
}