diff --git a/src/conky.h b/src/conky.h index 66c7a13e..32d32625 100644 --- a/src/conky.h +++ b/src/conky.h @@ -35,6 +35,7 @@ #if defined(__OpenBSD__) #include #include +#include #endif /* __OpenBSD__ */ #ifdef AUDACIOUS @@ -563,9 +564,10 @@ kvm_t *kd; #endif #if (defined(__FreeBSD__) || defined(__OpenBSD__)) && (defined(i386) || defined(__i386__)) -#ifdef __FreeBSD__ -int apm_getinfo(int fd, apm_info_t aip); +#ifdef __OpenBSD__ +typedef struct apm_power_info *apm_info_t; #endif +int apm_getinfo(int fd, apm_info_t aip); char *get_apm_adapter(void); char *get_apm_battery_life(void); char *get_apm_battery_time(void); diff --git a/src/openbsd.c b/src/openbsd.c index 3e0d3e9c..a5c05926 100644 --- a/src/openbsd.c +++ b/src/openbsd.c @@ -675,9 +675,9 @@ proc_find_top(struct process **cpu, struct process **mem) #define APM_UNKNOWN 255 int -apm_getinfo(int fd, void *null) +apm_getinfo(int fd, apm_info_t aip) { - if (ioctl(fd, APM_IOC_GETPOWER) == -1) + if (ioctl(fd, APM_IOC_GETPOWER, aip) == -1) return (-1); return (0);