aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2008-10-02 22:58:09 +0000
committerYang Tse <yangsita@gmail.com>2008-10-02 22:58:09 +0000
commitbdf17244128fc1c8c5b47273b1f3a6148015b079 (patch)
treeca0da4c9ae40b4eee4c767679e30974c90c25003
parent9cea2dfb8fc65868d054a87041feb6f778918fc3 (diff)
take 2 at fixing compiler warning: argument might be clobbered by `longjmp' or `vfork'
-rw-r--r--lib/hostip.c6
-rw-r--r--lib/hostip.h2
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/hostip.c b/lib/hostip.c
index f8c2be63f..1a5711f55 100644
--- a/lib/hostip.c
+++ b/lib/hostip.c
@@ -524,7 +524,7 @@ int Curl_resolv_timeout(struct connectdata *conn,
const char *hostname,
int port,
struct Curl_dns_entry **entry,
- volatile long timeout)
+ long timeoutms)
{
#ifdef USE_ALARM_TIMEOUT
#ifdef HAVE_SIGACTION
@@ -536,7 +536,7 @@ int Curl_resolv_timeout(struct connectdata *conn,
void (*keep_sigact)(int); /* store the old handler here */
#endif /* HAVE_SIGNAL */
#endif /* HAVE_SIGACTION */
-
+ volatile long timeout;
unsigned int prev_alarm=0;
struct SessionHandle *data = conn->data;
#endif /* USE_ALARM_TIMEOUT */
@@ -548,6 +548,8 @@ int Curl_resolv_timeout(struct connectdata *conn,
if (data->set.no_signal)
/* Ignore the timeout when signals are disabled */
timeout = 0;
+ else
+ timeout = timeoutms;
if(timeout && timeout < 1000)
/* The alarm() function only provides integer second resolution, so if
diff --git a/lib/hostip.h b/lib/hostip.h
index 08545d94e..593d2c5dc 100644
--- a/lib/hostip.h
+++ b/lib/hostip.h
@@ -166,7 +166,7 @@ int Curl_resolv(struct connectdata *conn, const char *hostname,
int port, struct Curl_dns_entry **dnsentry);
int Curl_resolv_timeout(struct connectdata *conn, const char *hostname,
int port, struct Curl_dns_entry **dnsentry,
- volatile long timeout);
+ long timeoutms);
/*
* Curl_ipvalid() checks what CURL_IPRESOLVE_* requirements that might've