version 1.14, 2011/04/28 06:19:57 |
version 1.15, 2011/05/02 22:24:23 |
|
|
#include <sys/un.h> |
#include <sys/un.h> |
|
|
#include <netinet/in.h> |
#include <netinet/in.h> |
|
#include <netinet/tcp.h> |
#include <netdb.h> |
#include <netdb.h> |
|
|
#include <err.h> |
#include <err.h> |
|
|
struct listen *f = (struct listen *)file; |
struct listen *f = (struct listen *)file; |
struct sockaddr caddr; |
struct sockaddr caddr; |
socklen_t caddrlen; |
socklen_t caddrlen; |
int sock; |
int sock, opt; |
|
|
if (pfd->revents & POLLIN) { |
if (pfd->revents & POLLIN) { |
caddrlen = sizeof(caddrlen); |
caddrlen = sizeof(caddrlen); |
|
|
perror("fcntl(sock, O_NONBLOCK)"); |
perror("fcntl(sock, O_NONBLOCK)"); |
close(sock); |
close(sock); |
return 0; |
return 0; |
|
} |
|
if (f->path == NULL) { |
|
opt = 1; |
|
if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, |
|
&opt, sizeof(int)) < 0) { |
|
perror("setsockopt"); |
|
close(sock); |
|
return 0; |
|
} |
} |
} |
if (sock_new(&sock_ops, sock) == NULL) { |
if (sock_new(&sock_ops, sock) == NULL) { |
close(sock); |
close(sock); |