summaryrefslogtreecommitdiff
path: root/hw/xfree86/os-support/linux/lnx_video.c
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2005-08-26 06:48:24 +0000
committerDaniel Stone <daniel@fooishbar.org>2005-08-26 06:48:24 +0000
commitc937faadd0a0a5f2598b84286ac1ed8996a512e5 (patch)
tree8b5d8d2ed4e2454e54b844327da5a7de30a2db5c /hw/xfree86/os-support/linux/lnx_video.c
parent6d34a2ac8a33bd6c9083106b38fab6062e033e39 (diff)
Better error message on failure to set iopl. (Debian #021)
Diffstat (limited to 'hw/xfree86/os-support/linux/lnx_video.c')
-rw-r--r--hw/xfree86/os-support/linux/lnx_video.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c
index 371295ffd..3da734f9a 100644
--- a/hw/xfree86/os-support/linux/lnx_video.c
+++ b/hw/xfree86/os-support/linux/lnx_video.c
@@ -29,6 +29,9 @@
#include <xorg-config.h>
#endif
+#include <errno.h>
+#include <string.h>
+
#include <X11/X.h>
#include "input.h"
#include "scrnintstr.h"
@@ -566,11 +569,14 @@ xf86EnableIO(void)
}
close(fd);
#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__)
- if (ioperm(0, 1024, 1) || iopl(3)) {
- xf86Msg(X_WARNING,
- "xf86EnableIOPorts: Failed to set IOPL for I/O\n");
+ if (ioperm(0, 1024, 1) || iopl(3)) {
+ if (errno == ENODEV)
+ ErrorF("xf86EnableIOPorts: no I/O ports found\n");
+ else
+ FatalError("xf86EnableIOPorts: failed to set IOPL"
+ " for I/O (%s)\n", strerror(errno));
return FALSE;
- }
+ }
# if !defined(__alpha__)
ioperm(0x40,4,0); /* trap access to the timer chip */
ioperm(0x60,4,0); /* trap access to the keyboard controller */