summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pccard/pccardc/wrattr.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/pccard/pccardc/wrattr.c')
-rw-r--r--usr.sbin/pccard/pccardc/wrattr.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/pccard/pccardc/wrattr.c b/usr.sbin/pccard/pccardc/wrattr.c
index e7857b9..51b57bc 100644
--- a/usr.sbin/pccard/pccardc/wrattr.c
+++ b/usr.sbin/pccard/pccardc/wrattr.c
@@ -26,7 +26,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: wrattr.c,v 1.10 1997/11/18 21:08:08 nate Exp $";
+ "$Id: wrattr.c,v 1.11 1999/02/05 16:00:16 kuriyama Exp $";
#endif /* not lint */
#include <err.h>
@@ -62,16 +62,19 @@ wrattr_main(argc, argv)
fd = open(name, O_RDWR);
if (fd < 0)
err(1, "%s", name);
+
reg = MDF_ATTR;
if (ioctl(fd, PIOCRWFLAG, &reg))
err(1, "ioctl (PIOCRWFLAG)");
+
if (sscanf(argv[2], "%x", &reg) != 1 ||
sscanf(argv[3], "%x", &value) != 1)
errx(1, "arg error");
+
offs = reg;
c = value;
lseek(fd, offs, SEEK_SET);
if (write(fd, &c, 1) != 1)
- warn("%s", name);
+ err(1, "%s", name);
return 0;
}
OpenPOWER on IntegriCloud