]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Change autounmountd(8) to use time_t for duration instead of double
authorjhibbits <jhibbits@FreeBSD.org>
Thu, 8 Aug 2019 03:16:32 +0000 (03:16 +0000)
committerjhibbits <jhibbits@FreeBSD.org>
Thu, 8 Aug 2019 03:16:32 +0000 (03:16 +0000)
commitd1115235daf2a6a2f3bcdb3c840722fbc548d2ee
tree629e8d4c26d7f25b8bd162b58cb7fb5a361f9d90
parent69fcf747ef9f9dea5aa9b60cff485771792c35cb
Change autounmountd(8) to use time_t for duration instead of double

Summary:
autounmountd(8) uses doubles to handle mount time durations.  However,
it must convert to integer types, time_t in particular, to do anything
meaningful.  Additionally, even though it's a floating-point value in
seconds, the sub-seconds component is never used, so it's unnecessary.

Switching type to time_t fixes an assertion on powerpc64, which checks
that a sleep value that's not -1.0 is greater than 0.  On powerpc64, it
happens that the value of -1.0 gets loaded as a float (perhaps a bug in
gcc), but gets compared to a double.  This compares as false, so follows
through the 'sleep != -1.0' path, and fails the assert.  Since the
sub-second component isn't used in the double, just drop it and deal
with whole-integer seconds.

Reviewed by: trasz
Differential Revision: https://reviews.freebsd.org/D21109
usr.sbin/autofs/autounmountd.c