mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-04 20:00:32 +01:00
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.
This commit is contained in:
parent
56804f4a3f
commit
ef8d696252
2 changed files with 3 additions and 6 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue