mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 11:50:14 +01:00
nmcli: fix "nmcli device monitor <dev>"
Call get_device_list() after next_arg(); call it only after checking that there are other arguments after "monitor". Fixes:6a3d77fbe6(cherry picked from commit2c4e991aba)
This commit is contained in:
parent
12d16e8a89
commit
d9ca557c1f
1 changed files with 3 additions and 3 deletions
|
|
@ -2443,9 +2443,6 @@ device_removed (NMClient *client, NMDevice *device, NmCli *nmc)
|
|||
static NMCResultCode
|
||||
do_devices_monitor (NmCli *nmc, int argc, char **argv)
|
||||
{
|
||||
GSList *queue = get_device_list (nmc, argc, argv);
|
||||
GSList *iter;
|
||||
|
||||
if (nmc->complete)
|
||||
return nmc->return_value;
|
||||
|
||||
|
|
@ -2462,6 +2459,9 @@ do_devices_monitor (NmCli *nmc, int argc, char **argv)
|
|||
nmc->should_wait++;
|
||||
g_signal_connect (nmc->client, NM_CLIENT_DEVICE_ADDED, G_CALLBACK (device_added), nmc);
|
||||
} else {
|
||||
GSList *queue = get_device_list (nmc, argc, argv);
|
||||
GSList *iter;
|
||||
|
||||
/* Monitor the specified devices. */
|
||||
for (iter = queue; iter; iter = g_slist_next (iter))
|
||||
device_watch (nmc, NM_DEVICE (iter->data));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue