mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-19 10:02:33 +01:00
agent: Make sure Release is sent when iwd exits
The main loop cannot be quit in signal handler as that would prevent the agent.c from sending the Release command to the agent.
This commit is contained in:
parent
02a8eddd8f
commit
e17d2d63c2
14
src/main.c
14
src/main.c
@ -33,6 +33,14 @@
|
||||
#include "src/wiphy.h"
|
||||
#include "src/kdbus.h"
|
||||
#include "src/dbus.h"
|
||||
#include "src/agent.h"
|
||||
|
||||
static struct l_timeout *timeout = NULL;
|
||||
|
||||
static void main_loop_quit(struct l_timeout *timeout, void *user_data)
|
||||
{
|
||||
l_main_quit();
|
||||
}
|
||||
|
||||
static void signal_handler(struct l_signal *signal, uint32_t signo,
|
||||
void *user_data)
|
||||
@ -41,7 +49,10 @@ static void signal_handler(struct l_signal *signal, uint32_t signo,
|
||||
case SIGINT:
|
||||
case SIGTERM:
|
||||
l_info("Terminate");
|
||||
l_main_quit();
|
||||
|
||||
agent_exit();
|
||||
|
||||
timeout = l_timeout_create(1, main_loop_quit, NULL, NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -171,6 +182,7 @@ destroy:
|
||||
|
||||
done:
|
||||
l_signal_remove(signal);
|
||||
l_timeout_remove(timeout);
|
||||
|
||||
return exit_status;
|
||||
}
|
||||
|
@ -132,7 +132,5 @@ bool manager_exit(struct l_dbus *dbus)
|
||||
l_dbus_unregister_interface(dbus, IWD_MANAGER_PATH,
|
||||
IWD_MANAGER_INTERFACE);
|
||||
|
||||
agent_exit();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user