X-Git-Url: http://www.dolda2000.com/gitweb/?a=blobdiff_plain;f=src%2Fplaintcp.c;h=b898e37a05b47d3ef6efd3ccff1934ff5c29f953;hb=0d7d8025971161a23aaf6da5238a194d4dcc3d3c;hp=cf46b29fd982925d3978d7bf90b3ab514ead8b05;hpb=7595e3a4d77b7e498fa84e27d93cc9f680076561;p=ashd.git diff --git a/src/plaintcp.c b/src/plaintcp.c index cf46b29..b898e37 100644 --- a/src/plaintcp.c +++ b/src/plaintcp.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -64,10 +65,11 @@ int listensock4(int port) close(fd); return(-1); } - if(listen(fd, 16) < 0) { + if(listen(fd, 128) < 0) { close(fd); return(-1); } + fcntl(fd, F_SETFD, FD_CLOEXEC); return(fd); } @@ -88,10 +90,11 @@ int listensock6(int port) close(fd); return(-1); } - if(listen(fd, 16) < 0) { + if(listen(fd, 128) < 0) { close(fd); return(-1); } + fcntl(fd, F_SETFD, FD_CLOEXEC); return(fd); }