mirror of
https://github.com/samba-team/samba.git
synced 2025-08-04 08:22:08 +03:00
r17834: Another bug found by Volker's tests in the build farm !
Correctly map large nt timevals to TIME_T_MAX. Jeremy.
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
c02970c272
commit
63b13d2879
@ -223,12 +223,6 @@ static struct timespec nt_time_to_unix_timespec(NTTIME *nt)
|
|||||||
return ret;
|
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 = (((uint64)nt->high) << 32 ) + ((uint64)nt->low);
|
||||||
/* d is now in 100ns units, since jan 1st 1601".
|
/* d is now in 100ns units, since jan 1st 1601".
|
||||||
Save off the ns fraction. */
|
Save off the ns fraction. */
|
||||||
@ -247,7 +241,7 @@ static struct timespec nt_time_to_unix_timespec(NTTIME *nt)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((time_t)d) >= TIME_T_MAX) {
|
if ((d >= (uint64)TIME_T_MAX)) {
|
||||||
ret.tv_sec = TIME_T_MAX;
|
ret.tv_sec = TIME_T_MAX;
|
||||||
ret.tv_nsec = 0;
|
ret.tv_nsec = 0;
|
||||||
return ret;
|
return ret;
|
||||||
|
Reference in New Issue
Block a user