Noux: return dummy time in 'gettimeofday()'

The 'find' program can abort if the 'gettimeofday()' function returns -1,
which it currently does. With this patch the 'gettimeofday()' returns a
dummy time instead to prevent such a termination.

Fixes #353.
This commit is contained in:
Christian Prochaska 2012-09-11 13:13:09 +02:00 committed by Norman Feske
parent 4b81cf3e63
commit d6402041bc

View File

@ -559,9 +559,14 @@ extern "C" int clock_gettime(clockid_t clk_id, struct timespec *tp)
extern "C" int gettimeofday(struct timeval *tv, struct timezone *tz) extern "C" int gettimeofday(struct timeval *tv, struct timezone *tz)
{ {
if (verbose) if (verbose)
PDBG("gettimeofdaye called - not implemented"); PDBG("gettimeofday() called - not implemented");
errno = EINVAL;
return -1; if (tv) {
tv->tv_sec = 0;
tv->tv_usec = 0;
}
return 0;
} }