X Tutup
Skip to content

Commit 9118155

Browse files
committed
busctl: use set_ensure_consume()
1 parent ccf609c commit 9118155

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/busctl/busctl.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -464,14 +464,6 @@ static int tree_one(sd_bus *bus, const char *service) {
464464
if (r < 0)
465465
return log_oom();
466466

467-
done = set_new(&string_hash_ops_free);
468-
if (!done)
469-
return log_oom();
470-
471-
failed = set_new(&string_hash_ops_free);
472-
if (!failed)
473-
return log_oom();
474-
475467
for (;;) {
476468
_cleanup_free_ char *p = NULL;
477469
int q;
@@ -488,7 +480,7 @@ static int tree_one(sd_bus *bus, const char *service) {
488480
if (q < 0 && r >= 0)
489481
r = q;
490482

491-
q = set_consume(q < 0 ? failed : done, TAKE_PTR(p));
483+
q = set_ensure_consume(q < 0 ? &failed : &done, &string_hash_ops_free, TAKE_PTR(p));
492484
assert(q != 0);
493485
if (q < 0)
494486
return log_oom();

0 commit comments

Comments
 (0)
X Tutup