On 2011/02/24 14:37, david.l.cantr...@gmail.com wrote:
> Attached are updated and new patches for the sysutils/conky port.  The
> patches enable the ${apm_adapter}, ${apm_battery_life}, and
> ${apm_battery_time} variables in conky on amd64.  There is also a patch to
> the man page explaining these variables are also available on OpenBSD.
> 
> I made these patches on the conky port from the OPENBSD_4_8 branch.  I am
> not sure if current has an updated conky port, but I do know that at least
> the latest stable upstream conky release does not have these patches.
> I've submitted these fixes to the upstream maintainers.

it's likely that every single port in the tree has changed
between OPENBSD_4_8 and OPENBSD_4_9, conky certainly has.

>       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
> +     }

did you check that multiple devices work properly? istr having
problems with this when i converted it to the new sensors api.

> -#if  defined(__i386) || defined(__x86_64)
> +#if  defined(__i386) || defined(__amd64)

no need for this, __x86_64 is already defined.

$ arch -s
amd64

$ cpp -dM /dev/null | grep x86
#define __x86_64 1
#define __x86_64__ 1

> +             || defined(__OpenBSD__)) \
> +             && (defined(i386) || defined(__i386__) || defined(__amd64__))

is it necessary to restrict arch like this? there are others
which use apm (probably at least zaurus, macppc, longsoon).

Reply via email to