e system rfkill - use list command for old rfkill output

some distros use an ancient rfkill without default listing of devices.
this adapts to work there.

@fix
This commit is contained in:
Carsten Haitzler 2020-04-15 15:30:18 +01:00
parent 4acee9e448
commit 1edddcda66
1 changed files with 2 additions and 2 deletions

View File

@ -107,7 +107,7 @@ _cb_rfkill_exe_data(void *data, int ev_type EINA_UNUSED, void *event)
char dev[1024];
id = -1;
if (sscanf(ev->lines[i].line, "%i %*s %1023s %*s %*s", &id, dev) == 2)
if (sscanf(ev->lines[i].line, "%i: %1023[^:] %*s", &id, dev) == 2)
{
if (!strcmp(a->dev, dev))
{
@ -135,7 +135,7 @@ _rfkill_do(Eina_Bool block, const char *dev)
_cb_rfkill_exe_data, a);
if ((!a->handle_del) || (!a->handle_data)) goto err;
// stage 1 - run to get list of devices and id's to know what id to use
a->exe = ecore_exe_pipe_run("rfkill",
a->exe = ecore_exe_pipe_run("rfkill list",
ECORE_EXE_NOT_LEADER |
ECORE_EXE_TERM_WITH_PARENT |
ECORE_EXE_PIPE_READ |