From 911815565ab143f90fcdb7d2e18fd2c58db6a62f Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sun, 10 Oct 2021 19:10:56 +0900 Subject: [PATCH] busctl: use set_ensure_consume() --- src/busctl/busctl.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/busctl/busctl.c b/src/busctl/busctl.c index 27210e93895..30a86234d92 100644 --- a/src/busctl/busctl.c +++ b/src/busctl/busctl.c @@ -464,14 +464,6 @@ static int tree_one(sd_bus *bus, const char *service) { if (r < 0) return log_oom(); - done = set_new(&string_hash_ops_free); - if (!done) - return log_oom(); - - failed = set_new(&string_hash_ops_free); - if (!failed) - return log_oom(); - for (;;) { _cleanup_free_ char *p = NULL; int q; @@ -488,7 +480,7 @@ static int tree_one(sd_bus *bus, const char *service) { if (q < 0 && r >= 0) r = q; - q = set_consume(q < 0 ? failed : done, TAKE_PTR(p)); + q = set_ensure_consume(q < 0 ? &failed : &done, &string_hash_ops_free, TAKE_PTR(p)); assert(q != 0); if (q < 0) return log_oom(); -- 2.47.3