diff options
author | ps <ps@FreeBSD.org> | 2005-08-26 01:00:19 +0000 |
---|---|---|
committer | ps <ps@FreeBSD.org> | 2005-08-26 01:00:19 +0000 |
commit | 55a9c3b304fa2075d9edafbcb0d7197a2a126dc5 (patch) | |
tree | 43f3a00f683fd10a498f808ded8bd1ed8d90b49f /sys/dev/pci/pci_user.c | |
parent | 23db593d68a7b8062c0c9230c1c6349a1dee96db (diff) | |
download | FreeBSD-src-55a9c3b304fa2075d9edafbcb0d7197a2a126dc5.zip FreeBSD-src-55a9c3b304fa2075d9edafbcb0d7197a2a126dc5.tar.gz |
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
Diffstat (limited to 'sys/dev/pci/pci_user.c')
-rw-r--r-- | sys/dev/pci/pci_user.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/dev/pci/pci_user.c b/sys/dev/pci/pci_user.c index f2a7ed9..6122ba5 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 <sys/param.h> #include <sys/systm.h> @@ -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: |