diff options
author | Mark Kettenis <mark.kettenis@xs4all.nl> | 2014-02-18 19:02:14 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-02-18 19:04:09 +0000 |
commit | c91af569ee90a832899c9038badd84921e9a87fc (patch) | |
tree | 5a4a5b9ff70362c13db7c786a93009d74ac7d82a /src | |
parent | ecc20fbcf8d5adb6c3b7d005c01788e35bba9d3c (diff) |
backlight: Build fixes for OpenBSD
Chris would like to humbly apologise for making these changes to the
OpenBSD code blind, and to thank Mark and Jonathan for their support
and understanding.
Diffstat (limited to 'src')
-rw-r--r-- | src/backlight.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/backlight.c b/src/backlight.c index 688819d7..6b74a21a 100644 --- a/src/backlight.c +++ b/src/backlight.c @@ -32,6 +32,7 @@ #include <sys/types.h> #include <sys/wait.h> #include <sys/stat.h> +#include <sys/ioctl.h> #include <stdio.h> #include <stdlib.h> @@ -66,18 +67,21 @@ * So we're left with spawning a helper child which gets levels to set written * to it through a pipe. This turns the blocking forever problem from a hung * machine problem into a simple backlight control not working problem. + * + * If only things were as simple as on OpenBSD! :) */ #ifdef __OpenBSD__ #include <dev/wscons/wsconsio.h> +#include <xf86Priv.h> int backlight_set(struct backlight *b, int level) { struct wsdisplay_param param; if (b->iface == NULL) - return; + return -1; if ((unsigned)level > b->max) level = b->max; @@ -129,6 +133,14 @@ int backlight_open(struct backlight *b, char *iface) return param.curval; } +enum backlight_type backlight_exists(const char *iface) +{ + if (iface != NULL) + return BL_NONE; + + return BL_PLATFORM; +} + #else static int |