adjust for sensors changes, unbreaks the build.

This commit is contained in:
sthen 2010-04-27 20:56:11 +00:00
parent 2e18d33420
commit 884315f468
4 changed files with 83 additions and 15 deletions

View File

@ -1,10 +1,11 @@
# $OpenBSD: Makefile,v 1.13 2010/03/21 11:35:26 ajacoutot Exp $ # $OpenBSD: Makefile,v 1.14 2010/04/27 20:56:11 sthen Exp $
ONLY_FOR_ARCHS= ${APM_ARCHS} ONLY_FOR_ARCHS= ${APM_ARCHS}
COMMENT= light-weight system monitor COMMENT= light-weight system monitor
DISTNAME= conky-1.7.2 DISTNAME= conky-1.7.2
PKGNAME= ${DISTNAME}p0
CATEGORIES= sysutils CATEGORIES= sysutils
HOMEPAGE= http://conky.sourceforge.net/ HOMEPAGE= http://conky.sourceforge.net/

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-configure,v 1.1 2009/11/23 16:46:24 benoit Exp $ $OpenBSD: patch-configure,v 1.2 2010/04/27 20:56:11 sthen Exp $
--- configure.orig Mon Sep 21 11:48:29 2009 --- configure.orig Tue Aug 25 00:01:58 2009
+++ configure Mon Sep 21 11:48:54 2009 +++ configure Tue Apr 27 19:50:09 2010
@@ -19845,7 +19845,7 @@ @@ -19845,7 +19845,7 @@ $as_echo "$ac_cv_search_clock_gettime" >&6; }
ac_res=$ac_cv_search_clock_gettime ac_res=$ac_cv_search_clock_gettime
if test "$ac_res" != no; then if test "$ac_res" != no; then
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"

View File

@ -0,0 +1,33 @@
$OpenBSD: patch-src_openbsd_c,v 1.8 2010/04/27 20:56:11 sthen Exp $
--- src/openbsd.c.orig Sat Aug 8 21:05:55 2009
+++ src/openbsd.c Tue Apr 27 20:40:38 2010
@@ -454,14 +454,13 @@ void update_obsd_sensors()
dev = obsd_sensors.device; // FIXME: read more than one device
- /* for (dev = 0; dev < MAXSENSORDEVICES; dev++) { */
+ for (dev = 0; dev < MAXSENSORDEVICES; dev++) {
mib[2] = dev;
if (sysctl(mib, 3, &sensordev, &sdlen, NULL, 0) == -1) {
- if (errno != ENOENT) {
- warn("sysctl");
- }
- return;
- // continue;
+ if (errno == ENOENT) /* end of sensors */
+ return;
+ if (errno == ENXIO) /* missing e.g. usb sensor that was unplugged */
+ continue;
}
for (type = 0; type < SENSOR_MAX_TYPES; type++) {
mib[3] = type;
@@ -496,7 +495,8 @@ void update_obsd_sensors()
sensor_cnt++;
}
}
- /* } */
+ break; // FIXME: read more than one device
+ }
init_sensors = 1;
}

View File

@ -1,11 +1,45 @@
$OpenBSD: patch-src_openbsd_h,v 1.2 2009/05/10 19:07:47 sthen Exp $ $OpenBSD: patch-src_openbsd_h,v 1.3 2010/04/27 20:56:11 sthen Exp $
--- src/openbsd.h.orig Mon Mar 30 05:44:25 2009 --- src/openbsd.h.orig Sat Aug 8 21:05:55 2009
+++ src/openbsd.h Sun May 10 12:07:14 2009 +++ src/openbsd.h Tue Apr 27 20:38:57 2010
@@ -2,6 +2,7 @@ @@ -11,38 +11,15 @@ void update_obsd_sensors(void);
#define OPENBSD_H_ void get_obsd_vendor(char *buf, size_t client_buffer_size);
void get_obsd_product(char *buf, size_t client_buffer_size);
+#ifndef MAXSENSORDEVICES
+#define MAXSENSORDEVICES 1024
+#endif
#define OBSD_MAX_SENSORS 256
struct obsd_sensors_struct {
int device;
float temp[MAXSENSORDEVICES][OBSD_MAX_SENSORS];
unsigned int fan[MAXSENSORDEVICES][OBSD_MAX_SENSORS];
float volt[MAXSENSORDEVICES][OBSD_MAX_SENSORS];
-};
-struct obsd_sensors_struct obsd_sensors;
-
-#if defined(i386) || defined(__i386__)
-typedef struct apm_power_info *apm_info_t;
-#endif
-
-#endif /*OPENBSD_H_*/
-#ifndef OPENBSD_H_
-#define OPENBSD_H_
-
-#include "common.h"
-#include <sys/sysctl.h>
-#include <sys/sensors.h>
-#include <machine/apmvar.h>
-
-void update_obsd_sensors(void);
-void get_obsd_vendor(char *buf, size_t client_buffer_size);
-void get_obsd_product(char *buf, size_t client_buffer_size);
-
-#define OBSD_MAX_SENSORS 256
-struct obsd_sensors_struct {
- int device;
- float temp[MAXSENSORDEVICES][OBSD_MAX_SENSORS];
- unsigned int fan[MAXSENSORDEVICES][OBSD_MAX_SENSORS];
- float volt[MAXSENSORDEVICES][OBSD_MAX_SENSORS];
};
struct obsd_sensors_struct obsd_sensors;
#include "common.h"
+#include <sys/param.h>
#include <sys/sysctl.h>
#include <sys/sensors.h>
#include <machine/apmvar.h>