From 36e77b1059ed7ba6c1852de2b1e63ffc48150d66 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ulf=20M=C3=B6ller?= Date: Mon, 1 May 2006 18:49:26 +0000 Subject: [PATCH] Bug fix. PR: 1307 Submitted by: Oliver Tappe --- apps/s_socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/s_socket.c b/apps/s_socket.c index d9321a0982..37e6cdc555 100644 --- a/apps/s_socket.c +++ b/apps/s_socket.c @@ -264,7 +264,7 @@ static int init_client_ip(int *sock, unsigned char ip[4], int port, int type) if (s == INVALID_SOCKET) { perror("socket"); return(0); } -#ifndef OPENSSL_SYS_MPE +#if defined(SO_KEEPALIVE) && !defined(OPENSSL_SYS_MPE) if (type == SOCK_STREAM) { i=0; @@ -274,7 +274,7 @@ static int init_client_ip(int *sock, unsigned char ip[4], int port, int type) #endif if (connect(s,(struct sockaddr *)&them,sizeof(them)) == -1) - { close(s); perror("connect"); return(0); } + { closesocket(s); perror("connect"); return(0); } *sock=s; return(1); } -- 2.25.1