diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2016-06-23 17:45:59 +0200 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2016-06-29 20:28:42 +0200 |
commit | ef8d696252bd36a9d495cad1e2527a311aa2bdf5 (patch) | |
tree | 54e14f35f4e6b0a78634d4c92339eb96a6282207 | |
parent | 56804f4a3f218cce3edda7939455ef9d60ec5096 (diff) | |
download | NetworkManager-ef8d696252bd36a9d495cad1e2527a311aa2bdf5.tar.gz |
cli: move the final completion check after the main loop exit
For "nmcli d modify" we'll need to do the completion from async
handlers. This seems to be the most reasonable place to ignore the
errors.
-rw-r--r-- | clients/cli/connections.c | 6 | ||||
-rw-r--r-- | clients/cli/nmcli.c | 3 |
2 files changed, 3 insertions, 6 deletions
diff --git a/clients/cli/connections.c b/clients/cli/connections.c index caf151fc51..bbe8b78b31 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -4758,9 +4758,6 @@ finish: if (connection) g_object_unref (connection); - /* shell completion - be sure to exit with success without printing errors */ - if (nmc->complete) - nmc->return_value = NMC_RESULT_SUCCESS; return nmc->return_value; } @@ -7818,9 +7815,6 @@ do_connection_modify (NmCli *nmc, nmc->should_wait++; finish: - /* shell completion - be sure to exit with success without printing errors */ - if (nmc->complete) - nmc->return_value = NMC_RESULT_SUCCESS; return nmc->return_value; } diff --git a/clients/cli/nmcli.c b/clients/cli/nmcli.c index 84bb4a23df..a203e407c3 100644 --- a/clients/cli/nmcli.c +++ b/clients/cli/nmcli.c @@ -640,6 +640,9 @@ main (int argc, char *argv[]) loop = g_main_loop_new (NULL, FALSE); /* create main loop */ g_main_loop_run (loop); /* run main loop */ + if (nm_cli.complete) + nm_cli.return_value = NMC_RESULT_SUCCESS; + /* Print result descripting text */ if (nm_cli.return_value != NMC_RESULT_SUCCESS) { g_printerr ("%s\n", nm_cli.return_text->str); |