mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-29 05:39:24 +01:00
client: add noninteractive support into main
This commit is contained in:
parent
9944b7b3b5
commit
a7aecb8573
@ -24,6 +24,7 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
#include <ell/ell.h>
|
#include <ell/ell.h>
|
||||||
|
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
@ -47,6 +48,7 @@ int main(int argc, char *argv[])
|
|||||||
int exit_status;
|
int exit_status;
|
||||||
struct l_signal *signal;
|
struct l_signal *signal;
|
||||||
sigset_t mask;
|
sigset_t mask;
|
||||||
|
bool interactive;
|
||||||
|
|
||||||
if (!l_main_init())
|
if (!l_main_init())
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
@ -59,16 +61,21 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
l_log_set_stderr();
|
l_log_set_stderr();
|
||||||
|
|
||||||
command_init();
|
interactive = command_init(argv, argc);
|
||||||
|
|
||||||
|
if (interactive)
|
||||||
display_init();
|
display_init();
|
||||||
|
|
||||||
dbus_proxy_init();
|
dbus_proxy_init();
|
||||||
|
|
||||||
l_main_run();
|
l_main_run();
|
||||||
|
|
||||||
exit_status = EXIT_SUCCESS;
|
|
||||||
|
|
||||||
dbus_proxy_exit();
|
dbus_proxy_exit();
|
||||||
|
|
||||||
|
if (interactive)
|
||||||
display_exit();
|
display_exit();
|
||||||
|
|
||||||
|
exit_status = command_get_exit_status();
|
||||||
command_exit();
|
command_exit();
|
||||||
|
|
||||||
l_signal_remove(signal);
|
l_signal_remove(signal);
|
||||||
|
Loading…
Reference in New Issue
Block a user