mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-26 10:39:23 +01:00
knownnetworks: Convert to IWD_MODULE
This commit is contained in:
parent
546c3c26d3
commit
800d57d095
@ -39,9 +39,6 @@ void network_exit();
|
|||||||
bool wsc_init(void);
|
bool wsc_init(void);
|
||||||
bool wsc_exit();
|
bool wsc_exit();
|
||||||
|
|
||||||
bool known_networks_init(void);
|
|
||||||
void known_networks_exit(void);
|
|
||||||
|
|
||||||
bool device_init(void);
|
bool device_init(void);
|
||||||
void device_exit(void);
|
void device_exit(void);
|
||||||
|
|
||||||
|
@ -605,7 +605,7 @@ static void known_network_frequencies_sync(void)
|
|||||||
l_settings_free(known_freqs);
|
l_settings_free(known_freqs);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool known_networks_init(void)
|
static int known_networks_init(void)
|
||||||
{
|
{
|
||||||
struct l_dbus *dbus = dbus_get_bus();
|
struct l_dbus *dbus = dbus_get_bus();
|
||||||
DIR *dir;
|
DIR *dir;
|
||||||
@ -616,7 +616,7 @@ bool known_networks_init(void)
|
|||||||
NULL, false)) {
|
NULL, false)) {
|
||||||
l_info("Unable to register %s interface",
|
l_info("Unable to register %s interface",
|
||||||
IWD_KNOWN_NETWORK_INTERFACE);
|
IWD_KNOWN_NETWORK_INTERFACE);
|
||||||
return false;
|
return -EPERM;
|
||||||
}
|
}
|
||||||
|
|
||||||
dir = opendir(DAEMON_STORAGEDIR);
|
dir = opendir(DAEMON_STORAGEDIR);
|
||||||
@ -624,7 +624,7 @@ bool known_networks_init(void)
|
|||||||
l_info("Unable to open %s: %s", DAEMON_STORAGEDIR,
|
l_info("Unable to open %s: %s", DAEMON_STORAGEDIR,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
l_dbus_unregister_interface(dbus, IWD_KNOWN_NETWORK_INTERFACE);
|
l_dbus_unregister_interface(dbus, IWD_KNOWN_NETWORK_INTERFACE);
|
||||||
return false;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
known_networks = l_queue_new();
|
known_networks = l_queue_new();
|
||||||
@ -661,10 +661,10 @@ bool known_networks_init(void)
|
|||||||
known_networks_watch_cb, NULL,
|
known_networks_watch_cb, NULL,
|
||||||
known_networks_watch_destroy);
|
known_networks_watch_destroy);
|
||||||
|
|
||||||
return true;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void known_networks_exit(void)
|
static void known_networks_exit(void)
|
||||||
{
|
{
|
||||||
struct l_dbus *dbus = dbus_get_bus();
|
struct l_dbus *dbus = dbus_get_bus();
|
||||||
|
|
||||||
@ -677,3 +677,5 @@ void known_networks_exit(void)
|
|||||||
|
|
||||||
l_dbus_unregister_interface(dbus, IWD_KNOWN_NETWORK_INTERFACE);
|
l_dbus_unregister_interface(dbus, IWD_KNOWN_NETWORK_INTERFACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IWD_MODULE(known_networks, known_networks_init, known_networks_exit)
|
||||||
|
@ -527,7 +527,6 @@ int main(int argc, char *argv[])
|
|||||||
station_init();
|
station_init();
|
||||||
wsc_init();
|
wsc_init();
|
||||||
network_init();
|
network_init();
|
||||||
known_networks_init();
|
|
||||||
|
|
||||||
if (iwd_modules_init() < 0)
|
if (iwd_modules_init() < 0)
|
||||||
goto fail_modules;
|
goto fail_modules;
|
||||||
@ -539,7 +538,6 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
fail_modules:
|
fail_modules:
|
||||||
iwd_modules_exit();
|
iwd_modules_exit();
|
||||||
known_networks_exit();
|
|
||||||
network_exit();
|
network_exit();
|
||||||
wsc_exit();
|
wsc_exit();
|
||||||
station_exit();
|
station_exit();
|
||||||
|
Loading…
Reference in New Issue
Block a user