* times.cc (gettimeofday): use GetSystemTimeAsFileTime to avoid a
conversion (FACTOR): correct value (genf): set milliseconds to zero, DOW to 4.
This commit is contained in:
parent
4ba9aab779
commit
e873a0c7f3
|
@ -1,3 +1,10 @@
|
||||||
|
2000-08-30 DJ Delorie <dj@redhat.com>
|
||||||
|
|
||||||
|
* times.cc (gettimeofday): use GetSystemTimeAsFileTime to avoid a
|
||||||
|
conversion
|
||||||
|
(FACTOR): correct value
|
||||||
|
(genf): set milliseconds to zero, DOW to 4.
|
||||||
|
|
||||||
2000-08-29 Egor Duda <deo@logos-m.ru>
|
2000-08-29 Egor Duda <deo@logos-m.ru>
|
||||||
|
|
||||||
* grp.cc (getgroups): fail with EINVAL if array is not large
|
* grp.cc (getgroups): fail with EINVAL if array is not large
|
||||||
|
|
|
@ -24,7 +24,7 @@ details. */
|
||||||
#include "sigproc.h"
|
#include "sigproc.h"
|
||||||
#include "pinfo.h"
|
#include "pinfo.h"
|
||||||
|
|
||||||
#define FACTOR (0x19db1ded53ea710LL)
|
#define FACTOR (0x19db1ded53e8000LL)
|
||||||
#define NSPERSEC 10000000LL
|
#define NSPERSEC 10000000LL
|
||||||
|
|
||||||
static void __stdcall timeval_to_filetime (timeval *time, FILETIME *out);
|
static void __stdcall timeval_to_filetime (timeval *time, FILETIME *out);
|
||||||
|
@ -134,12 +134,9 @@ gettimeofday (struct timeval *p, struct timezone *z)
|
||||||
|
|
||||||
if (p != NULL)
|
if (p != NULL)
|
||||||
{
|
{
|
||||||
SYSTEMTIME t;
|
|
||||||
FILETIME f;
|
FILETIME f;
|
||||||
|
|
||||||
GetSystemTime (&t);
|
GetSystemTimeAsFileTime (&f);
|
||||||
if (! SystemTimeToFileTime (&t, &f))
|
|
||||||
res = -1;
|
|
||||||
totimeval (p, &f, 0, 1);
|
totimeval (p, &f, 0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,12 +167,12 @@ genf ()
|
||||||
FILETIME f;
|
FILETIME f;
|
||||||
s.wYear = 1970;
|
s.wYear = 1970;
|
||||||
s.wMonth = 1;
|
s.wMonth = 1;
|
||||||
s.wDayOfWeek = 5;
|
s.wDayOfWeek = 4;
|
||||||
s.wDay = 1;
|
s.wDay = 1;
|
||||||
s.wHour = 0;
|
s.wHour = 0;
|
||||||
s.wMinute = 0;
|
s.wMinute = 0;
|
||||||
s.wSecond = 0;
|
s.wSecond = 0;
|
||||||
s.wMilliseconds = 1;
|
s.wMilliseconds = 0;
|
||||||
SystemTimeToFileTime (&s, &f);
|
SystemTimeToFileTime (&s, &f);
|
||||||
|
|
||||||
small_printf ("FILE TIME is %08x%08x\n",
|
small_printf ("FILE TIME is %08x%08x\n",
|
||||||
|
|
Loading…
Reference in New Issue