networkctl: list drop unused dbus connection

Do not acquire dbus connection as it is unused in list_links
This commit is contained in:
Anton Tiurin
2025-09-06 02:51:21 -07:00
committed by Zbigniew Jędrzejewski-Szmek
parent eb514a4bbf
commit 505deaff01

View File

@@ -1,6 +1,5 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "sd-bus.h"
#include "sd-netlink.h"
#include "sd-network.h"
@@ -14,7 +13,6 @@
#include "networkctl-util.h"
int list_links(int argc, char *argv[], void *userdata) {
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
_cleanup_(sd_netlink_unrefp) sd_netlink *rtnl = NULL;
_cleanup_(link_info_array_freep) LinkInfo *links = NULL;
_cleanup_(table_unrefp) Table *table = NULL;
@@ -25,10 +23,6 @@ int list_links(int argc, char *argv[], void *userdata) {
if (r != 0)
return r;
r = acquire_bus(&bus);
if (r < 0)
return r;
r = sd_netlink_open(&rtnl);
if (r < 0)
return log_error_errno(r, "Failed to connect to netlink: %m");