Page MenuHomeFreeBSD

Change autounmountd(8) to use time_t for duration instead of double
ClosedPublic

Authored by jhibbits on Jul 30 2019, 2:25 AM.
Tags
None
Referenced Files
F170112597: D21109.diff
Thu, Sep 3, 1:27 PM
F170087540: D21109.id60264.diff
Thu, Sep 3, 11:36 AM
F170044312: D21109.id.diff
Thu, Sep 3, 8:37 AM
Unknown Object (File)
Tue, Sep 1, 1:36 PM
Unknown Object (File)
Tue, Sep 1, 9:20 AM
Unknown Object (File)
Tue, Sep 1, 7:28 AM
Unknown Object (File)
Sun, Aug 30, 8:08 AM
Unknown Object (File)
Sun, Aug 30, 6:40 AM
Subscribers

Details

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.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable