mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-22 21:22:37 +01:00
hotspot: use known_network_update
If the file was modified we no longer need to completely remove and recreate the network_info.
This commit is contained in:
parent
ab5e83014c
commit
fe9376c74f
@ -341,6 +341,7 @@ static void hs20_dir_watch_cb(const char *filename,
|
|||||||
void *user_data)
|
void *user_data)
|
||||||
{
|
{
|
||||||
struct l_settings *new;
|
struct l_settings *new;
|
||||||
|
uint64_t connected_time;
|
||||||
struct hs20_config *config;
|
struct hs20_config *config;
|
||||||
|
|
||||||
L_AUTO_FREE_VAR(char *, full_path) = NULL;
|
L_AUTO_FREE_VAR(char *, full_path) = NULL;
|
||||||
@ -385,12 +386,11 @@ static void hs20_dir_watch_cb(const char *filename,
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case L_DIR_WATCH_EVENT_MODIFIED:
|
case L_DIR_WATCH_EVENT_MODIFIED:
|
||||||
config = l_queue_remove_if(hs20_settings, match_filename,
|
config = l_queue_find(hs20_settings, match_filename, full_path);
|
||||||
full_path);
|
|
||||||
if (!config)
|
if (!config)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
known_networks_remove(&config->super);
|
connected_time = l_path_get_mtime(full_path);
|
||||||
|
|
||||||
new = l_settings_new();
|
new = l_settings_new();
|
||||||
|
|
||||||
@ -399,13 +399,7 @@ static void hs20_dir_watch_cb(const char *filename,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
config = hs20_config_new(new, full_path);
|
known_network_update(&config->super, new, connected_time);
|
||||||
if (!config)
|
|
||||||
break;
|
|
||||||
|
|
||||||
known_networks_add(&config->super);
|
|
||||||
|
|
||||||
l_queue_push_head(hs20_settings, config);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case L_DIR_WATCH_EVENT_ACCESSED:
|
case L_DIR_WATCH_EVENT_ACCESSED:
|
||||||
|
Loading…
Reference in New Issue
Block a user