Date: Thursday May 3, 2001 @ 22:59
Author: cameron
Update of /home/netrek/cvsroot/Vanilla/robotd
In directory swashbuckler.fortress.real-time.com:/var/tmp/cvs-serv3277/robotd
Modified Files:
robot.c
Log Message:
replace obsolete ftime() with gettimeofday()
****************************************
Index: Vanilla/robotd/robot.c
diff -u Vanilla/robotd/robot.c:1.2 Vanilla/robotd/robot.c:1.3
--- Vanilla/robotd/robot.c:1.2 Thu Apr 26 18:41:50 2001
+++ Vanilla/robotd/robot.c Thu May 3 22:59:47 2001
@@ -1,9 +1,7 @@
#include <stdio.h>
#include <limits.h>
#include <math.h>
-#include <sys/types.h>
#include <sys/time.h>
-#include <sys/timeb.h>
#include "defs.h"
#include "struct.h"
#include "data.h"
@@ -1859,13 +1857,13 @@
mtime(x)
int x;
{
- struct timeb tm;
+ struct timeval tm;
static int mtime_cache;
int v;
if(x){
- ftime(&tm);
+ gettimeofday(&tm, NULL);
/* mask off 16 high bits and add in milliseconds */
- v = (tm.time & 0x0000ffff)*1000+tm.millitm;
+ v = (tm.tv_sec & 0x0000ffff)*1000+tm.tv_usec;
mtime_cache = v;
}
return mtime_cache;