tools: allow longer time periods
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 23 Apr 2024 10:04:51 +0000 (12:04 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 24 Apr 2024 07:55:36 +0000 (09:55 +0200)
commite943b144d5f01c4f3da0f7898f0ec244a07e9aa6
tree7dd676c291612148f22c0922a78db78d185125fd
parentbb5a2bbf5d254830502c3ef40ea22c49f557782c
tools: allow longer time periods

We currently store time as microseconds in 32-bit integers and allow
seconds as the longest time unit when parsing command-line arguments
limiting the time period possible to specify when passing arguments such
as --hold-period to 35 minutes. Let's use 64-bit integers to vastly
increase that.

Use nanosleep() instead of usleep() to extend the possible sleep time
range.

Reported-by: Gunnar Thörnqvist <gunnar@igl.se>
Link: https://lore.kernel.org/r/20240423100452.32958-4-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
configure.ac
tools/gpioget.c
tools/gpiomon.c
tools/gpionotify.c
tools/gpioset.c
tools/tools-common.c
tools/tools-common.h