mirror of
https://github.com/systemd/systemd
synced 2024-10-15 04:24:19 +00:00
service: explicitly cast float to usec_t
Let's cast these floats explicitly to usec_t, since implicit float-to-integer casts are dangerous business, and we should underline that there's a cast happening here.
This commit is contained in:
parent
ea792cacb9
commit
4ab426bf56
|
@ -311,8 +311,8 @@ usec_t service_restart_usec_next(Service *s) {
|
|||
* r_n : maximum restart usec (s->restart_max_delay_usec),
|
||||
* i : index of the next step (n_restarts_next - 1)
|
||||
* n : num maximum steps (s->restart_steps) */
|
||||
value = s->restart_usec * powl((long double) s->restart_max_delay_usec / s->restart_usec,
|
||||
(long double) (n_restarts_next - 1) / s->restart_steps);
|
||||
value = (usec_t) (s->restart_usec * powl((long double) s->restart_max_delay_usec / s->restart_usec,
|
||||
(long double) (n_restarts_next - 1) / s->restart_steps));
|
||||
}
|
||||
|
||||
log_unit_debug(UNIT(s), "Next restart interval calculated as: %s", FORMAT_TIMESPAN(value, 0));
|
||||
|
|
Loading…
Reference in a new issue