network: Make networks_connected return void

The return value from network_connected is not checked and even if one
of the storage operations fails the function should probably continue
so only print a message on error.
This commit is contained in:
Andrew Zaborowski 2018-07-22 14:15:17 +02:00 committed by Denis Kenzior
parent ea2b83e5a7
commit c2abc212ad
2 changed files with 5 additions and 8 deletions

View File

@ -139,7 +139,7 @@ bool network_seen(struct network *network, struct timespec *when)
return true; return true;
} }
bool network_connected(struct network *network) void network_connected(struct network *network)
{ {
int err; int err;
const char *strtype; const char *strtype;
@ -148,8 +148,6 @@ bool network_connected(struct network *network)
l_queue_push_head(networks, network->info); l_queue_push_head(networks, network->info);
strtype = security_to_str(network_get_security(network)); strtype = security_to_str(network_get_security(network));
if (!strtype)
return false;
err = storage_network_touch(strtype, network->info->ssid); err = storage_network_touch(strtype, network->info->ssid);
switch (err) { switch (err) {
@ -169,17 +167,16 @@ bool network_connected(struct network *network)
network->settings); network->settings);
break; break;
default: default:
return false; l_error("Error %i touching network config", err);
break;
} }
err = storage_network_get_mtime(strtype, network->info->ssid, err = storage_network_get_mtime(strtype, network->info->ssid,
&network->info->connected_time); &network->info->connected_time);
if (err < 0) if (err < 0)
return false; l_error("Error %i reading network timestamp", err);
network->info->is_known = true; network->info->is_known = true;
return true;
} }
void network_disconnected(struct network *network) void network_disconnected(struct network *network)

View File

@ -28,7 +28,7 @@ struct network;
struct scan_bss; struct scan_bss;
bool network_seen(struct network *network, struct timespec *when); bool network_seen(struct network *network, struct timespec *when);
bool network_connected(struct network *network); void network_connected(struct network *network);
void network_disconnected(struct network *network); void network_disconnected(struct network *network);
bool network_rankmod(const struct network *network, double *rankmod); bool network_rankmod(const struct network *network, double *rankmod);