patch-src_openbsd_up-backend_c 1.0 KB

12345678910111213141516171819202122232425262728
  1. $OpenBSD: patch-src_openbsd_up-backend_c,v 1.21 2016/08/29 08:40:38 jasper Exp $
  2. Add missing #include after https://cgit.freedesktop.org/upower/commit/?id=77239cc4470fc515e1c8c6c21005fa08f3b1b04e
  3. Remove pointless upperbound, SENSOR_MAX_TYPES has no meaning here and we
  4. break from the loop anyway when needed.
  5. https://bugs.freedesktop.org/show_bug.cgi?id=95257
  6. --- src/openbsd/up-backend.c.orig Wed Jul 29 14:47:49 2015
  7. +++ src/openbsd/up-backend.c Wed May 4 10:44:04 2016
  8. @@ -24,6 +24,7 @@
  9. #include "up-backend.h"
  10. #include "up-daemon.h"
  11. #include "up-device.h"
  12. +#include "up-backend-bsd-private.h"
  13. #include <string.h> /* strcmp() */
  14. static void up_backend_class_init (UpBackendClass *klass);
  15. @@ -461,7 +462,7 @@ up_backend_update_lid_status(UpDaemon *daemon) {
  16. /* go through all acpibtn devices, and check if one of the values match "lid"
  17. if so, use that device.
  18. */
  19. - for (dev = 0; SENSOR_MAX_TYPES; dev++) {
  20. + for (dev = 0; ; dev++) {
  21. mib[2] = dev;
  22. if (sysctl(mib, 3, &sensordev, &sdlen, NULL, 0) == -1) {
  23. if (errno == ENXIO)