mirror of
https://github.com/coreutils/coreutils.git
synced 2024-12-05 07:54:07 +08:00
Don't include gtod.h.
(GTOD_init): Remove function. (rpl_gettimeofday): Do its job here instead, rather than aborting.
This commit is contained in:
parent
8087128c07
commit
225d614f6f
@ -39,17 +39,9 @@
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "gtod.h"
|
||||
|
||||
static struct tm *localtime_buffer_addr;
|
||||
|
||||
void
|
||||
GTOD_init (void)
|
||||
{
|
||||
time_t t = 0;
|
||||
localtime_buffer_addr = localtime (&t);
|
||||
}
|
||||
|
||||
/* This is a wrapper for gettimeofday. It is used only on systems for which
|
||||
gettimeofday clobbers the static buffer used for localtime's result.
|
||||
|
||||
@ -63,7 +55,10 @@ rpl_gettimeofday (struct timeval *tv, struct timezone *tz)
|
||||
int result;
|
||||
|
||||
if (! localtime_buffer_addr)
|
||||
abort ();
|
||||
{
|
||||
time_t t = 0;
|
||||
localtime_buffer_addr = localtime (&t);
|
||||
}
|
||||
|
||||
save = *localtime_buffer_addr;
|
||||
result = gettimeofday (tv, tz);
|
||||
|
Loading…
Reference in New Issue
Block a user