batman: Fix adding batteries on Linux.

When we add a batman gadget to the desktop it previously would
reset the values of all existing batman instances. Here we
ignore the dummy instance used when adding to desktop or
a gadget bar.
This commit is contained in:
Alastair Poole 2019-12-22 21:47:33 +00:00
parent 72a962921c
commit e9200fb081
1 changed files with 6 additions and 0 deletions

View File

@ -43,6 +43,12 @@ _batman_udev_stop(Instance *inst)
Ac_Adapter *ac;
Battery *bat;
/* This is a dummy battery we return here. */
if (inst->cfg->batman.have_battery != 1)
{
return;
}
if (inst->cfg->batman.batwatch)
E_FREE_FUNC(inst->cfg->batman.batwatch, eeze_udev_watch_del);
if (inst->cfg->batman.acwatch)