From cf3bb1fd0e4006eae2e4d3a7bf43a090dec566eb Mon Sep 17 00:00:00 2001 From: dan Date: Mon, 17 Apr 2000 21:24:58 +0000 Subject: [PATCH] Bug fix in the networking code --- WINGs/connection.c | 9 ++++++--- WINGs/host.c | 9 +++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/WINGs/connection.c b/WINGs/connection.c index 1fdf3b38..941ed98c 100644 --- a/WINGs/connection.c +++ b/WINGs/connection.c @@ -1,7 +1,7 @@ /* * WINGs WMConnection function library * - * Copyright (c) 1999 Dan Pascu + * Copyright (c) 1999-2000 Dan Pascu * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -58,6 +58,11 @@ # define SA_RESTART 0 #endif +/* For some Solaris systems */ +#if !defined(HAVE_INET_ATON) && !defined(INADDR_NONE) +# define INADDR_NONE (-1) +#endif + /* Stuff for setting the sockets into non-blocking mode. */ /*#ifdef __POSIX_SOURCE # define NONBLOCK_OPT O_NONBLOCK @@ -67,10 +72,8 @@ #define NONBLOCK_OPT O_NONBLOCK - #define NETBUF_SIZE 4096 - #define DEF_TIMEOUT 600 /* 600 seconds == 10 minutes */ diff --git a/WINGs/host.c b/WINGs/host.c index 61785629..84c532e2 100644 --- a/WINGs/host.c +++ b/WINGs/host.c @@ -19,6 +19,7 @@ */ +#include "../src/config.h" #include #include @@ -30,9 +31,9 @@ #include "WUtil.h" -/* Tell stupid Solaris what's going on */ -#ifndef INADDR_NONE -#define INADDR_NONE (-1) +/* For some Solaris systems */ +#if !defined(HAVE_INET_ATON) && !defined(INADDR_NONE) +# define INADDR_NONE (-1) #endif @@ -171,7 +172,7 @@ WMGetHostWithAddress(char* address) if ((in.s_addr = inet_addr(address)) == INADDR_NONE) return NULL; #else - if (inet_aton(address, &in.s_addr) == 0) + if (inet_aton(address, &in) == 0) return NULL; #endif -- 2.11.4.GIT