mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
DAMN BERKELEY.
This commit is contained in:
parent
c5eb686096
commit
bd2e802053
1 changed files with 5 additions and 1 deletions
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
#include <netinet/tcp.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
@ -119,7 +120,7 @@ Success:
|
||||||
int
|
int
|
||||||
p9listen(char *dir, char *newdir)
|
p9listen(char *dir, char *newdir)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd, one;
|
||||||
|
|
||||||
if((fd = _p9netfd(dir)) < 0){
|
if((fd = _p9netfd(dir)) < 0){
|
||||||
werrstr("bad 'directory' in listen: %s", dir);
|
werrstr("bad 'directory' in listen: %s", dir);
|
||||||
|
@ -129,6 +130,9 @@ p9listen(char *dir, char *newdir)
|
||||||
if((fd = accept(fd, nil, nil)) < 0)
|
if((fd = accept(fd, nil, nil)) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
one = 1;
|
||||||
|
setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char*)&one, sizeof one);
|
||||||
|
|
||||||
putfd(newdir, fd);
|
putfd(newdir, fd);
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue