diff options
author | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2024-04-23 12:04:49 +0200 |
---|---|---|
committer | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2024-04-24 09:55:36 +0200 |
commit | 9df101d6d6bac5a9ef42692034f3c2cfe9f2f521 (patch) | |
tree | 723c2997c7d9290ae5e442b5e809f70e386b5f52 | |
parent | 4f0953c4da78c249eb6b230d9ce801405eca78cb (diff) | |
download | libgpiod-9df101d6d6bac5a9ef42692034f3c2cfe9f2f521.tar.gz |
tools: rename timeout to idle_timeout in gpiomon and gpionotify
Use a more meaningful name for the variable storing the idle timeout
value.
Suggested-by: Kent Gibson <warthog618@gmail.com>
Link: https://lore.kernel.org/r/20240423100452.32958-2-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-rw-r--r-- | tools/gpiomon.c | 8 | ||||
-rw-r--r-- | tools/gpionotify.c | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/tools/gpiomon.c b/tools/gpiomon.c index e3abb2d9..40e6ac2f 100644 --- a/tools/gpiomon.c +++ b/tools/gpiomon.c @@ -30,7 +30,7 @@ struct config { const char *fmt; enum gpiod_line_clock event_clock; int timestamp_fmt; - int timeout; + int idle_timeout; }; static void print_help(void) @@ -143,7 +143,7 @@ static int parse_config(int argc, char **argv, struct config *cfg) memset(cfg, 0, sizeof(*cfg)); cfg->edges = GPIOD_LINE_EDGE_BOTH; cfg->consumer = "gpiomon"; - cfg->timeout = -1; + cfg->idle_timeout = -1; for (;;) { optc = getopt_long(argc, argv, shortopts, longopts, &opti); @@ -176,7 +176,7 @@ static int parse_config(int argc, char **argv, struct config *cfg) cfg->fmt = optarg; break; case 'i': - cfg->timeout = parse_period_or_die(optarg) / 1000; + cfg->idle_timeout = parse_period_or_die(optarg) / 1000; break; case 'l': cfg->active_low = true; @@ -453,7 +453,7 @@ int main(int argc, char **argv) for (;;) { fflush(stdout); - ret = poll(pollfds, resolver->num_chips, cfg.timeout); + ret = poll(pollfds, resolver->num_chips, cfg.idle_timeout); if (ret < 0) die_perror("error polling for events"); diff --git a/tools/gpionotify.c b/tools/gpionotify.c index 2c565905..d2aee152 100644 --- a/tools/gpionotify.c +++ b/tools/gpionotify.c @@ -23,7 +23,7 @@ struct config { const char *chip_id; const char *fmt; int timestamp_fmt; - int timeout; + int idle_timeout; }; static void print_help(void) @@ -108,7 +108,7 @@ static int parse_config(int argc, char **argv, struct config *cfg) int opti, optc; memset(cfg, 0, sizeof(*cfg)); - cfg->timeout = -1; + cfg->idle_timeout = -1; for (;;) { optc = getopt_long(argc, argv, shortopts, longopts, &opti); @@ -132,7 +132,7 @@ static int parse_config(int argc, char **argv, struct config *cfg) cfg->fmt = optarg; break; case 'i': - cfg->timeout = parse_period_or_die(optarg) / 1000; + cfg->idle_timeout = parse_period_or_die(optarg) / 1000; break; case 'n': cfg->events_wanted = parse_uint_or_die(optarg); @@ -422,7 +422,7 @@ int main(int argc, char **argv) for (;;) { fflush(stdout); - ret = poll(pollfds, resolver->num_chips, cfg.timeout); + ret = poll(pollfds, resolver->num_chips, cfg.idle_timeout); if (ret < 0) die_perror("error polling for events"); |