summaryrefslogtreecommitdiff
path: root/devel/ecos-tools/files/patch-host::tools::Utils::common::eCosStd.cpp
blob: cb9b07ec0882e7c197a2e817de2ea8b5d77e0c6c (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
$FreeBSD$

Index: ../ecos/host/tools/Utils/common/eCosStd.cpp
===================================================================
RCS file: /home/tg/cvs/ecos/host/tools/Utils/common/eCosStd.cpp,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 eCosStd.cpp
--- host/tools/Utils/common/eCosStd.cpp	22 Aug 2003 11:37:35 -0000	1.1.1.1
+++ host/tools/Utils/common/eCosStd.cpp	6 Sep 2003 17:23:26 -0000
@@ -33,10 +33,12 @@
   SystemTimeToFileTime(&st,(FILETIME *)&ft);
   return Time(ft)/10000;
 #else // UNIX
-  struct timeb tp;
-  ftime(&tp);
+  struct timeval tv;
+  struct timezone tz;
+  
+  gettimeofday(&tv, &tz);
   // A negative time would be bad news, but we're not in touble until 2038
-  return 1000*Time(tp.time)+tp.millitm;
+  return 1000*Time(tv.tv_sec)+tv.tv_usec/1000;
 #endif
 }