Merge pull request #4047 from igungor/lakka-fix-is_online

Fix WiFi online detection
This commit is contained in:
Jean-André Santoni 2016-11-25 14:35:23 +01:00 committed by GitHub
commit 9652be89cd

View File

@ -102,7 +102,20 @@ static bool connmanctl_ssid_is_online(unsigned i)
if (connman_counter == 60)
{
connman_counter = 0;
strlcpy(service, line+25, sizeof(service));
static struct string_list* list = NULL;
list = string_split(line, " ");
if (!list)
return false;
if (list->size == 0)
{
string_list_free(list);
return false;
}
strlcpy(service, list->elems[list->size-1].data, sizeof(service));
string_list_free(list);
strlcat(command, "connmanctl services ", sizeof(command));
strlcat(command, service, sizeof(command));
@ -149,12 +162,14 @@ static bool connmanctl_connect_ssid(unsigned i, const char* passphrase)
if (!list)
return false;
if (list->size == 0) {
if (list->size == 0)
{
string_list_free(list);
return false;
}
for (int i = 0; i < list->size-1; i++) {
for (int i = 0; i < list->size-1; i++)
{
strlcat(name, list->elems[i].data, sizeof(name));
strlcat(name, " ", sizeof(name));
}