From 8910aa92ae05e18a86516024d95d0691c9c55210 Mon Sep 17 00:00:00 2001 From: Paul Saab Date: Fri, 26 Aug 2005 01:00:19 +0000 Subject: [PATCH] For FreeBSD 4 binaries, when trying to read from a device that does not exsist, do not have ioctl return an error, but instead set -1 in the data returned to the user. This allows the HP bios flash utilities to work without requiring changes to their code. Reviewed by: jhb --- sys/dev/pci/pci_user.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/pci_user.c b/sys/dev/pci/pci_user.c index f2a7ed9fd7f0..6122ba576733 100644 --- a/sys/dev/pci/pci_user.c +++ b/sys/dev/pci/pci_user.c @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include "opt_bus.h" /* XXX trim includes */ +#include "opt_compat.h" #include #include @@ -411,7 +412,13 @@ getconfexit: io->pi_width); error = 0; } else { - error = ENODEV; +#ifdef COMPAT_FREEBSD4 + if (cmd == PCIOCREAD) { + io->pi_data = -1; + error = 0; + } else +#endif + error = ENODEV; } break; default: