Exit early if no sensors matched.

Previously, if it finds that there are no sensors or no matching labels
it would create the bus and then spin on the interval indefinitely doing
nothing but occupying precious memory.  Not that this is a case that is
likely to happen in real-use, but it is a reasonable edge execution case
that can be easily addressed.  I ran into this when trying to
momentarily stop it from reading the fans while I was running timing
code.  I had simply commented out the fan labels, but the program ran
anyway -- now it didn't read the fans, but it seemed odd that it didn't
simply exit when it had nothing to do.

There is a comment about checking for new sensors in the map, but this
idea isn't fully fleshed out.  Therefore, in the interim, this is a
perfectly reasonable execution flow modification.

Change-Id: Idd2a9568b09148ffffe1af5c00193a0f394ec6a6
Signed-off-by: Patrick Venture <venture@google.com>
1 file changed
tree: 6aaae67c75184353078decb48eeacae6476c871a
  1. test/
  2. .gitignore
  3. argument.cpp
  4. argument.hpp
  5. bootstrap.sh
  6. configure.ac
  7. env.cpp
  8. env.hpp
  9. fan_speed.cpp
  10. fan_speed.hpp
  11. hwmon.hpp
  12. interface.hpp
  13. LICENSE
  14. mainloop.cpp
  15. mainloop.hpp
  16. Makefile.am
  17. readd.cpp
  18. README.md
  19. sensorset.cpp
  20. sensorset.hpp
  21. sysfs.cpp
  22. sysfs.hpp
  23. targets.hpp
  24. thresholds.hpp
  25. util.hpp
README.md

Exposes generic hwmon entries as DBus objects.

To Build

To build this package, do the following steps:

    1. ./bootstrap.sh
    2. ./configure ${CONFIGURE_FLAGS}
    3. make

To full clean the repository again run `./bootstrap.sh clean`.