mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-08-03 17:59:07 -04:00
38 lines
786 B
Plaintext
38 lines
786 B
Plaintext
$NetBSD: patch-ag,v 1.1.1.1 1999/12/20 03:05:16 hubertf Exp $
|
|
|
|
--- src/dispswitch.c.orig Fri Dec 17 14:07:03 1999
|
|
+++ src/dispswitch.c Mon Dec 20 03:34:54 1999
|
|
@@ -40,7 +40,14 @@
|
|
#include<signal.h>
|
|
#include<paths.h>
|
|
#include<pwd.h>
|
|
+#ifdef Linux
|
|
#include<features.h>
|
|
+#endif
|
|
+#ifdef __NetBSD__
|
|
+#include <sys/types.h>
|
|
+#include <machine/sysarch.h>
|
|
+#include <err.h>
|
|
+#endif
|
|
#ifdef __GLIBC__
|
|
#include<sys/perm.h>
|
|
#endif
|
|
@@ -276,10 +283,17 @@
|
|
|
|
/* get the necessary I/O permissions */
|
|
|
|
+#ifdef __NetBSD__
|
|
+ if (i386_iopl(3) == -1) {
|
|
+ warn("i386_iopl");
|
|
+ return 1;
|
|
+ }
|
|
+#else
|
|
if (ioperm(0xb2, 1, 1)) {
|
|
fprintf(stderr, "dispswitch: can't get I/O permissions.\n");
|
|
return 1;
|
|
}
|
|
+#endif
|
|
|
|
/* drop root priveleges to minimize the risk of running suid root */
|
|
|