fix pnpinfo on arch=amd64

Alexander Best arundel at freebsd.org
Sun Oct 24 00:22:49 UTC 2010


this tiny patch will fix pnpinfo so it doesn't core dump (bus error) any
longer on arch=amd64.

cheers.
alex

-- 
a13x
-------------- next part --------------
diff --git a/contrib/pnpinfo/pnpinfo.c b/contrib/pnpinfo/pnpinfo.c
index 790cfd8..c09f4ef 100644
--- a/contrib/pnpinfo/pnpinfo.c
+++ b/contrib/pnpinfo/pnpinfo.c
@@ -588,7 +588,7 @@ main(int argc, char **argv)
 {
     int num_pnp_devs;
 
-#ifdef __i386__
+#if defined(__i386__) || defined(__amd64__)
     /* Hey what about a i386_iopl() call :) */
     if (open("/dev/io", O_RDONLY) < 0)
 	errx(1, "can't get I/O privilege");


More information about the freebsd-hackers mailing list