summaryrefslogtreecommitdiff
path: root/emu/port/ipif-posix.c
diff options
context:
space:
mode:
Diffstat (limited to 'emu/port/ipif-posix.c')
-rw-r--r--emu/port/ipif-posix.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/emu/port/ipif-posix.c b/emu/port/ipif-posix.c
index 5af79f50..77b5f85d 100644
--- a/emu/port/ipif-posix.c
+++ b/emu/port/ipif-posix.c
@@ -261,24 +261,6 @@ so_bind(int fd, int su, unsigned long addr, unsigned short port)
oserror();
}
-void
-so_setsockopt(int fd, int opt, int value)
-{
- int r;
- struct linger l;
-
- if(opt == SO_LINGER){
- l.l_onoff = 1;
- l.l_linger = (short) value;
- osenter();
- r = setsockopt(fd, SOL_SOCKET, opt, (char *)&l, sizeof(l));
- osleave();
- }else
- error(Ebadctl);
- if(r < 0)
- oserror();
-}
-
int
so_gethostbyname(char *host, char**hostv, int n)
{
@@ -341,13 +323,13 @@ so_getservbyname(char *service, char *net, char *port)
}
int
-so_hangup(int fd, int linger)
+so_hangup(int fd, int nolinger)
{
int r;
- static struct linger l = {1, 1000};
+ static struct linger l = {1, 0};
osenter();
- if(linger)
+ if(nolinger)
setsockopt(fd, SOL_SOCKET, SO_LINGER, (char*)&l, sizeof(l));
r = shutdown(fd, 2);
if(r >= 0)