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
|
* 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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -58,6 +58,11 @@
|
|||||||
# define SA_RESTART 0
|
# define SA_RESTART 0
|
||||||
#endif
|
#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. */
|
/* Stuff for setting the sockets into non-blocking mode. */
|
||||||
/*#ifdef __POSIX_SOURCE
|
/*#ifdef __POSIX_SOURCE
|
||||||
# define NONBLOCK_OPT O_NONBLOCK
|
# define NONBLOCK_OPT O_NONBLOCK
|
||||||
@@ -67,10 +72,8 @@
|
|||||||
|
|
||||||
#define NONBLOCK_OPT O_NONBLOCK
|
#define NONBLOCK_OPT O_NONBLOCK
|
||||||
|
|
||||||
|
|
||||||
#define NETBUF_SIZE 4096
|
#define NETBUF_SIZE 4096
|
||||||
|
|
||||||
|
|
||||||
#define DEF_TIMEOUT 600 /* 600 seconds == 10 minutes */
|
#define DEF_TIMEOUT 600 /* 600 seconds == 10 minutes */
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "../src/config.h"
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -30,8 +31,8 @@
|
|||||||
#include "WUtil.h"
|
#include "WUtil.h"
|
||||||
|
|
||||||
|
|
||||||
/* Tell stupid Solaris what's going on */
|
/* For some Solaris systems */
|
||||||
#ifndef INADDR_NONE
|
#if !defined(HAVE_INET_ATON) && !defined(INADDR_NONE)
|
||||||
# define INADDR_NONE (-1)
|
# define INADDR_NONE (-1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -171,7 +172,7 @@ WMGetHostWithAddress(char* address)
|
|||||||
if ((in.s_addr = inet_addr(address)) == INADDR_NONE)
|
if ((in.s_addr = inet_addr(address)) == INADDR_NONE)
|
||||||
return NULL;
|
return NULL;
|
||||||
#else
|
#else
|
||||||
if (inet_aton(address, &in.s_addr) == 0)
|
if (inet_aton(address, &in) == 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user