aboutsummaryrefslogtreecommitdiff
path: root/net/hawknl-devel/files/patch-src_htcondition.c
blob: 08aef0fa79d7abca56db110b16ddcba1f963202b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--- src/htcondition.c	Sun Mar  5 16:05:39 2006
+++ src/htcondition.c	Sun Mar  5 16:06:17 2006
@@ -37,8 +37,6 @@
 
 #else /* !HT_WIN_THREADS */
 
-#include <sys/timeb.h>
-
 #ifdef HL_WINDOWS_APP
 #define timeb _timeb
 #define ftime _ftime
@@ -156,13 +154,14 @@
 #else
         int                 result = 0;
         struct timespec     tv;
-        struct timeb        t;
+        struct timeval       t;
+        struct timezone     tz;
         long                ms;
 
         /* convert timeout to an absolute time */
-        ftime(&t);
-        ms = t.millitm + timeout;
-        tv.tv_sec = t.time + (ms / 1000);
+	gettimeofday(&t, &tz);
+        ms = (t.tv_sec * 1000) + timeout;
+        tv.tv_sec = t.tv_sec + (ms / 1000);
         tv.tv_nsec = (ms % 1000) * 1000000;
 
         (void)pthread_mutex_lock((pthread_mutex_t *)&cv->mutex);