]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
logger: fix LOGGER_TEST_TIMEOFDAY check
authorKarel Zak <kzak@redhat.com>
Mon, 23 Mar 2015 10:40:45 +0000 (11:40 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 23 Mar 2015 10:40:45 +0000 (11:40 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/logger.c

index 17325cee5f6dad8d3d6835791e793109f2ff397b..edc94836b0b25b567710e2456f27eca46166b962 100644 (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) {
                tv->tv_sec = sec;
                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);