sysinfo: Don't use fallback when not implemented.

There is no fallback mechanism for BSD systems. We need to avoid
polling here as it will break E on first poll of data.

Essentially, if we fail to find a battery, we use a broken
fallback mechanism which breaks E. Don't do this :)
This commit is contained in:
Alastair Poole 2020-04-17 15:23:57 +01:00
parent 3b705cbdd9
commit 876f509be4
1 changed files with 3 additions and 1 deletions

View File

@ -1251,7 +1251,9 @@ dir_has_contents(const char *dir)
int
_batman_fallback_start(Instance *inst)
{
#if defined(HAVE_CFBASE_H) /* OS X */
#if defined(__OpenBSD__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__)
return 0;
#elif defined(HAVE_CFBASE_H) /* OS X */
darwin_init();
#else
if ((ecore_file_is_dir(sys_power_dir)) && (dir_has_contents(sys_power_dir)))