Browse Source

Merge commit '564fd36' into cg_merges_20130524b

Conflicts:
	compat.h
Luke Dashjr 12 years ago
parent
commit
3365d444bf
1 changed files with 4 additions and 2 deletions
  1. 4 2
      compat.h

+ 4 - 2
compat.h

@@ -79,12 +79,14 @@ struct tm *localtime_convert(time_t t)
 #endif
 
 #ifndef HAVE_NANOSLEEP
+extern void cgtime(struct timeval *);
+
 static inline int nanosleep(const struct timespec *req, struct timespec *rem)
 {
 	struct timeval tstart;
 	DWORD msecs;
 
-	gettimeofday(&tstart, NULL);
+	cgtime(&tstart);
 	msecs = (req->tv_sec * 1000) + ((999999 + req->tv_nsec) / 1000000);
 
 	if (SleepEx(msecs, true) == WAIT_IO_COMPLETION) {
@@ -97,7 +99,7 @@ static inline int nanosleep(const struct timespec *req, struct timespec *rem)
 				++tdone.tv_sec;
 			}
 
-			gettimeofday(&tnow, NULL);
+			cgtime(&tnow);
 			if (timercmp(&tnow, &tdone, >))
 				return 0;
 			timersub(&tdone, &tnow, &tleft);