mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-26 06:30:36 +01:00
cli/device: replace some duplicate code with find_wifi_device_by_iface()
This commit is contained in:
parent
1d8ab4e276
commit
d2842d16e3
1 changed files with 1 additions and 10 deletions
|
|
@ -2637,16 +2637,7 @@ do_device_wifi_list (NmCli *nmc, int argc, char **argv)
|
|||
|
||||
devices = nmc_get_devices_sorted (nmc->client);
|
||||
if (ifname) {
|
||||
/* Device specified - list only APs of this interface */
|
||||
for (i = 0; devices[i]; i++) {
|
||||
NMDevice *candidate = devices[i];
|
||||
const char *dev_iface = nm_device_get_iface (candidate);
|
||||
|
||||
if (!g_strcmp0 (dev_iface, ifname)) {
|
||||
device = candidate;
|
||||
break;
|
||||
}
|
||||
}
|
||||
device = find_wifi_device_by_iface (devices, ifname, NULL);
|
||||
if (!device) {
|
||||
g_string_printf (nmc->return_text, _("Error: Device '%s' not found."), ifname);
|
||||
nmc->return_value = NMC_RESULT_ERROR_NOT_FOUND;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue