summaryrefslogtreecommitdiff
path: root/src/busctl/busctl.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-03-16 22:32:23 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-03-19 08:33:33 +0900
commitde010b0b2e50cf0b3837ce350b116bc92605f67a (patch)
tree226685fbb97461692562035501ebc21a314f718c /src/busctl/busctl.c
parent80a226b26b5e00a2ef9e85d1321da44cd14d051b (diff)
downloadsystemd-de010b0b2e50cf0b3837ce350b116bc92605f67a.tar.gz
strv: make iterator in STRV_FOREACH() declaread in the loop
This also avoids multiple evaluations in STRV_FOREACH_BACKWARDS()
Diffstat (limited to 'src/busctl/busctl.c')
-rw-r--r--src/busctl/busctl.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/busctl/busctl.c b/src/busctl/busctl.c
index b532de4f9b..0f97015bd4 100644
--- a/src/busctl/busctl.c
+++ b/src/busctl/busctl.c
@@ -143,7 +143,7 @@ static int list_bus_names(int argc, char **argv, void *userdata) {
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
_cleanup_hashmap_free_ Hashmap *names = NULL;
_cleanup_(table_unrefp) Table *table = NULL;
- char **i, *k;
+ char *k;
void *v;
int r;
@@ -504,7 +504,6 @@ static int tree_one(sd_bus *bus, const char *service) {
static int tree(int argc, char **argv, void *userdata) {
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
- char **i;
int r;
/* Do superficial verification of arguments before even opening the bus */
@@ -1208,7 +1207,6 @@ static int monitor(int argc, char **argv, int (*dump)(sd_bus_message *m, FILE *f
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
_cleanup_(sd_bus_message_unrefp) sd_bus_message *message = NULL;
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
- char **i;
uint32_t flags = 0;
const char *unique_name;
bool is_monitor = false;
@@ -2124,7 +2122,6 @@ static int emit_signal(int argc, char **argv, void *userdata) {
static int get_property(int argc, char **argv, void *userdata) {
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
- char **i;
int r;
r = acquire_bus(false, &bus);