2012-11-06 10:45:33 +01:00
|
|
|
Index: Drivers/Postgre7.1/socket.c
|
|
|
|
===================================================================
|
|
|
|
--- Drivers/Postgre7.1/socket.c.orig
|
2007-01-16 00:40:12 +01:00
|
|
|
+++ Drivers/Postgre7.1/socket.c
|
2012-11-06 10:45:33 +01:00
|
|
|
@@ -100,7 +100,7 @@ SOCK_connect_to_ip(SocketClass *self, un
|
2007-01-16 00:40:12 +01:00
|
|
|
{
|
|
|
|
struct hostent *host;
|
|
|
|
struct sockaddr_in sadr;
|
|
|
|
-unsigned long iaddr;
|
|
|
|
+struct in_addr iaddr;
|
|
|
|
|
|
|
|
if (self->socket != -1) {
|
|
|
|
self->errornumber = SOCKET_ALREADY_CONNECTED;
|
2012-11-06 10:45:33 +01:00
|
|
|
@@ -113,8 +113,8 @@ unsigned long iaddr;
|
2007-01-16 00:40:12 +01:00
|
|
|
/* If it is a valid IP address, use it.
|
|
|
|
Otherwise use hostname lookup.
|
|
|
|
*/
|
|
|
|
- iaddr = inet_addr(hostname);
|
|
|
|
- if (iaddr == INADDR_NONE) {
|
|
|
|
+ iaddr.s_addr = inet_addr(hostname);
|
|
|
|
+ if (iaddr.s_addr == INADDR_NONE) {
|
|
|
|
host = gethostbyname(hostname);
|
|
|
|
if (host == NULL) {
|
|
|
|
self->errornumber = SOCKET_HOST_NOT_FOUND;
|