changes to timemodule.c

lance@markv.com
Tue, 1 Feb 94 14:40:20 PST

Here are some diffs to get time.time() to work correctly
on SCO ODT 3.0 since they have a broken gettimeofday() call.

*** timemodule.c.orig Tue Feb 1 14:29:16 1994
--- timemodule.c Tue Feb 1 14:30:25 1994
***************
*** 45,51 ****
#include "mytime.h"
#endif

! #if !HAVE_GETTIMEOFDAY && HAVE_FTIME
#include <sys/timeb.h>
#endif

--- 45,51 ----
#include "mytime.h"
#endif

! #if HAVE_FTIME
#include <sys/timeb.h>
#endif

***************
*** 305,311 ****
--- 305,320 ----
#ifdef HAVE_GETTIMEOFDAY
struct timeval t;
if (gettimeofday(&t, (struct timezone *)NULL) != 0)
+ /* This is a SCO ODT 3.0 HACK! */
+ #ifdef M_UNIX
+ {
+ struct timeb t;
+ ftime(&t);
+ return (double)t.time + t.millitm*0.001;
+ }
+ #else
return 0.0;
+ #endif
return (double)t.tv_sec + t.tv_usec*0.000001;
#else /* !HAVE_GETTIMEOFDAY */
#ifdef HAVE_FTIME

--

Lance Ellinghouse lance@markv.com UNIX Systems Support support@markv.com Mark V Systems Limited Voice: +1 818 995 7671 FAX: +1 818 995 4267