logger: fix LOGGER_TEST_TIMEOFDAY check

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2015-03-23 11:40:45 +01:00
parent 711ebe0e6b
commit 98e90a4901
1 changed files with 1 additions and 1 deletions

View File

@ -131,7 +131,7 @@ static inline int logger_gettimeofday(struct timeval *tv, struct timezone *tz)
if (str && sscanf(str, "%ju.%ju", &sec, &usec) == 2) { if (str && sscanf(str, "%ju.%ju", &sec, &usec) == 2) {
tv->tv_sec = sec; tv->tv_sec = sec;
tv->tv_usec = usec; tv->tv_usec = usec;
return tv->tv_sec == sec && tv->tv_usec == usec; return tv->tv_sec >= 0 && tv->tv_usec >= 0 ? 0 : -EINVAL;
} }
return gettimeofday(tv, tz); return gettimeofday(tv, tz);