mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-08-03 17:59:07 -04:00
52 lines
1.0 KiB
Plaintext
52 lines
1.0 KiB
Plaintext
$NetBSD: patch-aj,v 1.1.1.1 1999/12/20 03:05:16 hubertf Exp $
|
|
|
|
--- src/hotkey.c.orig Fri Dec 17 14:07:03 1999
|
|
+++ src/hotkey.c Mon Dec 20 03:36:44 1999
|
|
@@ -59,9 +59,18 @@
|
|
#include<stdio.h>
|
|
#include<stdlib.h>
|
|
#include<string.h>
|
|
+#ifdef Linux
|
|
#include<asm/io.h>
|
|
+#endif
|
|
#include<unistd.h>
|
|
+#ifdef Linux
|
|
#include<features.h>
|
|
+#endif
|
|
+#ifdef __NetBSD__
|
|
+#include <sys/types.h>
|
|
+#include <machine/sysarch.h>
|
|
+#include <err.h>
|
|
+#endif
|
|
#include<signal.h>
|
|
#include<sys/types.h>
|
|
#include<paths.h>
|
|
@@ -76,6 +85,9 @@
|
|
#include<X11/Xlib.h>
|
|
#include<X11/Xlocale.h>
|
|
|
|
+#ifdef __NetBSD__
|
|
+#undef setlocale
|
|
+#endif
|
|
|
|
#include"hotkey.h"
|
|
#include"sci.h"
|
|
@@ -455,10 +467,17 @@
|
|
|
|
/* get the necessary I/O permissions */
|
|
|
|
+#ifdef __NetBSD__
|
|
+ if (i386_iopl(3) == -1) {
|
|
+ warn("i386_iopl");
|
|
+ return 1;
|
|
+ }
|
|
+#else
|
|
if (iopl(3)) {
|
|
fprintf(stderr, "hotkey: can't get I/O permissions.\n");
|
|
return 1;
|
|
}
|
|
+#endif
|
|
|
|
/* drop root priveleges to minimize security risk of running suid root */
|
|
/*
|