r17834: Another bug found by Volker's tests in the build farm !
authorJeremy Allison <jra@samba.org>
Fri, 25 Aug 2006 16:25:09 +0000 (16:25 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:38:52 +0000 (11:38 -0500)
Correctly map large nt timevals to TIME_T_MAX.
Jeremy.

source/lib/time.c

index 192a418e7a116019182de291df52bdc3d3183e40..2db10f98d9d934bd57aec5149750d4f75a168a06 100644 (file)
@@ -223,12 +223,6 @@ static struct timespec nt_time_to_unix_timespec(NTTIME *nt)
                return ret;
        }
 
-       if ((nt->high == 0x7fffffff) && (nt->low == 0xffffffff)) {
-               ret.tv_sec = TIME_T_MAX;
-               ret.tv_nsec = 0;
-               return ret;
-       }
-
        d = (((uint64)nt->high) << 32 ) + ((uint64)nt->low);
        /* d is now in 100ns units, since jan 1st 1601".
           Save off the ns fraction. */
@@ -247,7 +241,7 @@ static struct timespec nt_time_to_unix_timespec(NTTIME *nt)
                return ret;
        }
 
-       if (((time_t)d) >= TIME_T_MAX) {
+       if ((d >= (uint64)TIME_T_MAX)) {
                ret.tv_sec = TIME_T_MAX;
                ret.tv_nsec = 0;
                return ret;