mirror of
https://github.com/linux-can/can-utils.git
synced 2026-08-05 06:20:00 +02:00
cangen: use long long in time computation for -g to support >2.1s
The computation of nanosleep times for the "-g" option (delay between sends) overflows when more than 2100ms are given. Signed-off-by: Konrad Anton <konrad.anton@awinia.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
committed by
Marc Kleine-Budde
parent
ca313a52a8
commit
667356cc36
@@ -269,7 +269,7 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ts.tv_sec = gap / 1000;
|
ts.tv_sec = gap / 1000;
|
||||||
ts.tv_nsec = ((int)(gap * 1000000)) % 1000000000;
|
ts.tv_nsec = (long)(((long long)(gap * 1000000)) % 1000000000ll);
|
||||||
|
|
||||||
/* recognize obviously missing commandline option */
|
/* recognize obviously missing commandline option */
|
||||||
if (id_mode == MODE_FIX && frame.can_id > 0x7FF && !extended) {
|
if (id_mode == MODE_FIX && frame.can_id > 0x7FF && !extended) {
|
||||||
|
|||||||
Reference in New Issue
Block a user