2008-06-30 17:00 UTC+0100 Miguel Angel Marchuet <miguelangel@marchuet.net>

* source/rtl/hbinet.c
    + Added define SOCKET_ERROR, that is missing in some compilers.
This commit is contained in:
Miguel Angel Marchuet Frutos
2008-06-30 14:57:17 +00:00
parent b61a54168a
commit 2bb2bc5437
2 changed files with 12 additions and 2 deletions

View File

@@ -8,6 +8,10 @@
2008-12-31 13:59 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2008-06-30 17:00 UTC+0100 Miguel Angel Marchuet <miguelangel@marchuet.net>
* source/rtl/hbinet.c
+ Added define SOCKET_ERROR, that is missing in some compilers.
2008-06-30 16:36 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* contrib/hbtip/tests/tiptest.prg
! Remove strings as arrays access. Thanks Lorenzo.

View File

@@ -226,6 +226,12 @@ static void hb_inetLinuxSigusrHandle( int sig )
}
#endif
// some compilers has missing this define
#ifndef SOCKET_ERROR
#define SOCKET_ERROR (-1)
#endif
/* JC1: we need it volatile to be minimally thread safe. */
static volatile int s_iSessions = 0;
@@ -472,10 +478,10 @@ static int hb_socketConnect( HB_SOCKET_STRUCT *Socket )
int value;
socklen_t len = sizeof(value);
if( getsockopt( Socket->com, SOL_SOCKET, SO_SNDBUF, (char *) &value, &len ) == 0 )
if( getsockopt( Socket->com, SOL_SOCKET, SO_SNDBUF, (char *) &value, &len ) != SOCKET_ERROR )
{
Socket->iSndBufSize = value;
if( getsockopt( Socket->com, SOL_SOCKET, SO_RCVBUF, (char *) &value, &len ) == 0 )
if( getsockopt( Socket->com, SOL_SOCKET, SO_RCVBUF, (char *) &value, &len ) != SOCKET_ERROR )
{
Socket->iRcvBufSize = value;
}