-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
this patch fix the assert() call raised when we can't bind any socket from
the user's selected port range. Now behavies correctly.
12:06:51: [WRN] Licq: Ignoring stale lockfile (pid 6945)
12:06:52: [WRN] Failed to start local TCP server:
Permission denied
12:06:52: [ERR] Unable to allocate TCP port for local server (No ports
available)!
-----BEGIN PGP SIGNATURE-----
iD8DBQE9PCJVUMlRieHkprgRAhl0AKCSN8ePC6Y9Rdm/HO4qIiCXu+HrHwCfWVbw
V2T86YHl2grqQ2ginD/lf5o=
=tKXF
-----END PGP SIGNATURE-----
Index: src/socket.cpp
===================================================================
RCS file: /cvsroot/licq/licq/src/socket.cpp,v
retrieving revision 1.21
diff -u -d -p -r1.21 socket.cpp
--- src/socket.cpp 24 May 2002 18:43:15 -0000 1.21
+++ src/socket.cpp 22 Jul 2002 15:08:48 -0000
@@ -449,6 +449,8 @@ bool INetSocket::StartServer(unsigned in
if (setsockopt(m_nDescriptor, IPPROTO_IP, IP_PORTRANGE, &i, sizeof(i))<0)
{
m_nErrorType = SOCK_ERROR_errno;
+ ::close(m_Descriptor);
+ m_nDescriptor = -1;
return(false);
}
#endif
@@ -460,6 +462,8 @@ bool INetSocket::StartServer(unsigned in
if (bind(m_nDescriptor, (struct sockaddr *)&m_sLocalAddr, sizeof(sockaddr_in)) == -1)
{
m_nErrorType = SOCK_ERROR_errno;
+ ::close(m_nDescriptor);
+ m_nDescriptor = -1;
return (false);
}