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:
parent
4acee9e448
commit
1edddcda66
|
@ -107,7 +107,7 @@ _cb_rfkill_exe_data(void *data, int ev_type EINA_UNUSED, void *event)
|
||||||
char dev[1024];
|
char dev[1024];
|
||||||
|
|
||||||
id = -1;
|
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))
|
if (!strcmp(a->dev, dev))
|
||||||
{
|
{
|
||||||
|
@ -135,7 +135,7 @@ _rfkill_do(Eina_Bool block, const char *dev)
|
||||||
_cb_rfkill_exe_data, a);
|
_cb_rfkill_exe_data, a);
|
||||||
if ((!a->handle_del) || (!a->handle_data)) goto err;
|
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
|
// 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_NOT_LEADER |
|
||||||
ECORE_EXE_TERM_WITH_PARENT |
|
ECORE_EXE_TERM_WITH_PARENT |
|
||||||
ECORE_EXE_PIPE_READ |
|
ECORE_EXE_PIPE_READ |
|
||||||
|
|
Loading…
Reference in New Issue