cURL / Mailing Lists / curl-library / Single Mail

curl-library

NetWare CLIB ares build broken due lack of gettimeofday()

From: Guenter Knauf <eflash_at_gmx.net>
Date: Mon, 22 Oct 2007 21:38:20 +0200

Hi,
since ares_init.c v1.63 the NetWare CLIB port got broken due lack of gettimeofday().
From what I see we only use a resolution of 1 sec here - would it be ok that I apply the patch below?
Or am I missing something here?

--- ares_init.c.orig Sat Oct 20 17:11:52 2007
+++ ares_init.c Mon Oct 22 21:35:08 2007
@@ -107,7 +107,6 @@
   int i;
   int status = ARES_SUCCESS;
   struct server_state *server;
- struct timeval tv;
 
 #ifdef CURLDEBUG
   const char *env = getenv("CARES_MEMDEBUG");
@@ -147,8 +146,7 @@
   channel->sock_state_cb = NULL;
   channel->sock_state_cb_data = NULL;
 
- gettimeofday(&tv, NULL);
- channel->last_timeout_processed = tv.tv_sec;
+ channel->last_timeout_processed = (long)time(NULL);
 
   /* Initialize our lists of queries */
   ares__init_list_head(&(channel->all_queries));

Guen.
Received on 2007-10-22