mbox series

[libgpiod,v3,0/4] tools: timeout handling improvements

Message ID 20240423100452.32958-1-brgl@bgdev.pl
Headers show
Series tools: timeout handling improvements | expand

Message

Bartosz Golaszewski April 23, 2024, 10:04 a.m. UTC
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

Here's an assortment of improvements to parsing and handling of timeouts
in gpio-tools.

I still decided to unify the period parsing between gpioset and gpioget even
if it doesn't make much sense for gpioget to support periods longer than
fractions of a second. Let users decide.

v2 -> v3:
- only initialize the timespec containing the timeout value once before
  entering the for loop

v1 -> v2:
- extend the series with renaming the timeout variable, using ppoll() instead
  of poll() and supporting minutes as time unit
- drop already applied patch

Bartosz Golaszewski (4):
  tools: rename timeout to idle_timeout in gpiomon and gpionotify
  tools: use ppoll() where higher timeout resolution makes sense
  tools: allow longer time periods
  tools: add minutes as a new supported time unit

 configure.ac         |  2 ++
 tools/gpioget.c      |  4 ++--
 tools/gpiomon.c      | 28 +++++++++++++++++++++-------
 tools/gpionotify.c   | 16 ++++++++++++----
 tools/gpioset.c      | 16 ++++++++--------
 tools/tools-common.c | 32 ++++++++++++++++++++++----------
 tools/tools-common.h |  5 +++--
 7 files changed, 70 insertions(+), 33 deletions(-)

Comments

Bartosz Golaszewski April 24, 2024, 8:06 a.m. UTC | #1
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>


On Tue, 23 Apr 2024 12:04:48 +0200, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> 
> Here's an assortment of improvements to parsing and handling of timeouts
> in gpio-tools.
> 
> I still decided to unify the period parsing between gpioset and gpioget even
> if it doesn't make much sense for gpioget to support periods longer than
> fractions of a second. Let users decide.
> 
> [...]

Applied, thanks!

[1/4] tools: rename timeout to idle_timeout in gpiomon and gpionotify
      commit: 9df101d6d6bac5a9ef42692034f3c2cfe9f2f521
[2/4] tools: use ppoll() where higher timeout resolution makes sense
      commit: bb5a2bbf5d254830502c3ef40ea22c49f557782c
[3/4] tools: allow longer time periods
      commit: e943b144d5f01c4f3da0f7898f0ec244a07e9aa6
[4/4] tools: add minutes as a new supported time unit
      commit: c34a572c535000d48dde12a805b38731dc33deb1

Best regards,