From aec4e1cfa3246269a5e9db524aafe64485ebdacd Mon Sep 17 00:00:00 2001 From: bms Date: Wed, 13 Apr 2005 19:13:46 +0000 Subject: Fix pciutils for recent pci changes in src/sys/dev/pci/pci_user.c. This fix is backwards compatible. Reviewed by: imp, maintainer --- sysutils/pciutils/files/patch-lib::fbsd-device.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'sysutils') diff --git a/sysutils/pciutils/files/patch-lib::fbsd-device.c b/sysutils/pciutils/files/patch-lib::fbsd-device.c index 1f168f55def..5558cdd9957 100644 --- a/sysutils/pciutils/files/patch-lib::fbsd-device.c +++ b/sysutils/pciutils/files/patch-lib::fbsd-device.c @@ -1,8 +1,10 @@ ---- lib/fbsd-device.c.orig Fri Jun 13 11:11:29 2003 -+++ lib/fbsd-device.c Fri Jun 13 11:21:52 2003 -@@ -14,9 +14,19 @@ +--- lib/fbsd-device.c.orig Tue Jul 20 07:01:31 1999 ++++ lib/fbsd-device.c Tue Apr 12 10:49:09 2005 +@@ -13,10 +13,21 @@ + #include #include ++#include #include +#include @@ -22,3 +24,18 @@ #include "internal.h" +@@ -75,8 +86,12 @@ + pi.pi_reg = pos; + pi.pi_width = len; + +- if (ioctl(d->access->fd, PCIOCREAD, &pi) < 0) +- d->access->error("fbsd_read: ioctl(PCIOCREAD) failed"); ++ if (ioctl(d->access->fd, PCIOCREAD, &pi) < 0) { ++ if (errno == ENODEV) ++ return 0; ++ else ++ d->access->error("fbsd_read: ioctl(PCIOCREAD) failed"); ++ } + + switch (len) + { -- cgit