Limit timeout for end of slew to avoid overflow

This commit is contained in:
Miroslav Lichvar 2010-01-21 17:11:17 +01:00
parent 4593471ad5
commit 52d0c9a057

View file

@ -353,7 +353,9 @@ initiate_slew(void)
fast_slewing = 1; fast_slewing = 1;
slew_start_tv = T0a; slew_start_tv = T0a;
/* Set up timeout for end of slew */ /* Set up timeout for end of slew, limit to one week */
if (dseconds > 3600 * 24 * 7)
dseconds = 3600 * 24 * 7;
UTI_AddDoubleToTimeval(&T0a, dseconds, &end_of_slew); UTI_AddDoubleToTimeval(&T0a, dseconds, &end_of_slew);
slew_timeout_id = SCH_AddTimeout(&end_of_slew, handle_end_of_slew, NULL); slew_timeout_id = SCH_AddTimeout(&end_of_slew, handle_end_of_slew, NULL);