From d6402041bc96b382e4cbcf232f5d29e5d16c0275 Mon Sep 17 00:00:00 2001 From: Christian Prochaska Date: Tue, 11 Sep 2012 13:13:09 +0200 Subject: [PATCH] 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. --- ports/src/lib/libc_noux/plugin.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ports/src/lib/libc_noux/plugin.cc b/ports/src/lib/libc_noux/plugin.cc index 023f3d203..033228cba 100644 --- a/ports/src/lib/libc_noux/plugin.cc +++ b/ports/src/lib/libc_noux/plugin.cc @@ -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) { if (verbose) - PDBG("gettimeofdaye called - not implemented"); - errno = EINVAL; - return -1; + PDBG("gettimeofday() called - not implemented"); + + if (tv) { + tv->tv_sec = 0; + tv->tv_usec = 0; + } + + return 0; }