mirror of
https://github.com/mirror/wget.git
synced 2025-01-21 09:41:06 +08:00
[svn] Fix broken Windows builds due to the xxx_with_timeout stuff.
Submitted by Ian Abbotti in <3CBB2FFE.20193.73A594@localhost>.
This commit is contained in:
parent
886470568c
commit
caa0f23be3
@ -1,3 +1,11 @@
|
|||||||
|
2002-04-15 Ian Abbott <abbotti@mev.co.uk>
|
||||||
|
|
||||||
|
* host.c (SET_H_ERRNO): New function-like macro to set `h_errno'.
|
||||||
|
(gethostbyname_with_timeout): Use it.
|
||||||
|
|
||||||
|
* utils.c: Don't define `SETJMP()', `run_with_timeout_env' or
|
||||||
|
`abort_run_with_timeout()' when `USE_SIGNAL_TIMEOUT' is undefined.
|
||||||
|
|
||||||
2002-04-15 Hrvoje Niksic <hniksic@arsdigita.com>
|
2002-04-15 Hrvoje Niksic <hniksic@arsdigita.com>
|
||||||
|
|
||||||
* host.c (getaddrinfo_with_timeout): New function.
|
* host.c (getaddrinfo_with_timeout): New function.
|
||||||
|
@ -35,6 +35,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
|
|
||||||
#ifdef WINDOWS
|
#ifdef WINDOWS
|
||||||
# include <winsock.h>
|
# include <winsock.h>
|
||||||
|
# define SET_H_ERRNO(err) WSASetLastError(err)
|
||||||
#else
|
#else
|
||||||
# include <sys/socket.h>
|
# include <sys/socket.h>
|
||||||
# include <netinet/in.h>
|
# include <netinet/in.h>
|
||||||
@ -42,6 +43,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
# include <arpa/inet.h>
|
# include <arpa/inet.h>
|
||||||
# endif
|
# endif
|
||||||
# include <netdb.h>
|
# include <netdb.h>
|
||||||
|
# define SET_H_ERRNO(err) ((void)(h_errno = (err)))
|
||||||
#endif /* WINDOWS */
|
#endif /* WINDOWS */
|
||||||
|
|
||||||
#ifndef NO_ADDRESS
|
#ifndef NO_ADDRESS
|
||||||
@ -487,7 +489,7 @@ gethostbyname_with_timeout (const char *host_name, int timeout)
|
|||||||
ctx.host_name = host_name;
|
ctx.host_name = host_name;
|
||||||
if (run_with_timeout (timeout, gethostbyname_with_timeout_callback, &ctx))
|
if (run_with_timeout (timeout, gethostbyname_with_timeout_callback, &ctx))
|
||||||
{
|
{
|
||||||
h_errno = HOST_NOT_FOUND;
|
SET_H_ERRNO (HOST_NOT_FOUND);
|
||||||
errno = ETIMEDOUT;
|
errno = ETIMEDOUT;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -1812,6 +1812,7 @@ debug_test_md5 (char *buf)
|
|||||||
|
|
||||||
/* Implementation of run_with_timeout, a generic timeout handler for
|
/* Implementation of run_with_timeout, a generic timeout handler for
|
||||||
systems with Unix-like signal handling. */
|
systems with Unix-like signal handling. */
|
||||||
|
#ifdef USE_SIGNAL_TIMEOUT
|
||||||
# ifdef HAVE_SIGSETJMP
|
# ifdef HAVE_SIGSETJMP
|
||||||
# define SETJMP(env) sigsetjmp (env, 1)
|
# define SETJMP(env) sigsetjmp (env, 1)
|
||||||
|
|
||||||
@ -1843,6 +1844,7 @@ abort_run_with_timeout (int sig)
|
|||||||
longjmp (run_with_timeout_env, -1);
|
longjmp (run_with_timeout_env, -1);
|
||||||
}
|
}
|
||||||
# endif /* not HAVE_SIGSETJMP */
|
# endif /* not HAVE_SIGSETJMP */
|
||||||
|
#endif /* USE_SIGNAL_TIMEOUT */
|
||||||
|
|
||||||
int
|
int
|
||||||
run_with_timeout (long timeout, void (*fun) (void *), void *arg)
|
run_with_timeout (long timeout, void (*fun) (void *), void *arg)
|
||||||
|
Loading…
Reference in New Issue
Block a user