diff options
Diffstat (limited to 'usr.sbin/pccard/pccardc/rdreg.c')
-rw-r--r-- | usr.sbin/pccard/pccardc/rdreg.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/pccard/pccardc/rdreg.c b/usr.sbin/pccard/pccardc/rdreg.c index 0605d5b..da28f52 100644 --- a/usr.sbin/pccard/pccardc/rdreg.c +++ b/usr.sbin/pccard/pccardc/rdreg.c @@ -26,7 +26,7 @@ #ifndef lint static const char rcsid[] = - "$Id: rdreg.c,v 1.9 1997/11/18 21:08:07 nate Exp $"; + "$Id: rdreg.c,v 1.10 1999/02/05 16:00:16 kuriyama Exp $"; #endif /* not lint */ #include <err.h> @@ -38,6 +38,7 @@ static const char rcsid[] = #include <sys/ioctl.h> #include <pccard/cardinfo.h> + void dumpslot(sl) int sl; @@ -47,7 +48,7 @@ dumpslot(sl) struct pcic_reg r; sprintf(name, CARD_DEVICE, sl); - fd = open(name, O_RDWR); + fd = open(name, O_RDONLY); if (fd < 0) { warn("%s", name); return; @@ -55,7 +56,7 @@ dumpslot(sl) printf("Registers for slot %d\n", sl); for (r.reg = 0; r.reg < 0x40; r.reg++) { if (ioctl(fd, PIOCGREG, &r)) { - warn("ioctl"); + err(1, "ioctl (PIOCGREG)"); break; } if ((r.reg % 16) == 0) |