mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 04:48:06 +01:00
Bug fix in the networking code
This commit is contained in:
@@ -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 */
|
||||
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "../src/config.h"
|
||||
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
@@ -30,8 +31,8 @@
|
||||
#include "WUtil.h"
|
||||
|
||||
|
||||
/* Tell stupid Solaris what's going on */
|
||||
#ifndef INADDR_NONE
|
||||
/* 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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user