diff options
author | mav <mav@FreeBSD.org> | 2016-10-07 01:32:29 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2016-10-07 01:32:29 +0000 |
commit | 96275c9972c56c9a949db09089da6a6830fc3084 (patch) | |
tree | ebf01d478421311949e8fdf2ef649f30b6f70c37 /usr.sbin | |
parent | db8336b3b5dc7d45eade8e5b892602873e104a69 (diff) | |
download | FreeBSD-src-96275c9972c56c9a949db09089da6a6830fc3084.zip FreeBSD-src-96275c9972c56c9a949db09089da6a6830fc3084.tar.gz |
MFC r306528: Fix `sesutil fault` operation.
Fault and ident bits are located in different control bytes, so previous
code was just doing nothing, writing into reserved bit.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/sesutil/sesutil.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.sbin/sesutil/sesutil.c b/usr.sbin/sesutil/sesutil.c index f3fa40b..48b77102 100644 --- a/usr.sbin/sesutil/sesutil.c +++ b/usr.sbin/sesutil/sesutil.c @@ -118,10 +118,16 @@ do_led(int fd, unsigned int idx, bool onoff, bool setfault) err(EXIT_FAILURE, "ENCIOC_GETELMSTAT"); } o.cstat[0] |= 0x80; - if (onoff) { - o.cstat[2] |= (setfault ? 0x20 : 0x02); + if (setfault) { + if (onoff) + o.cstat[3] |= 0x20; + else + o.cstat[3] &= 0xdf; } else { - o.cstat[2] &= (setfault ? 0xdf : 0xfd); + if (onoff) + o.cstat[2] |= 0x02; + else + o.cstat[2] &= 0xfd; } if (ioctl(fd, ENCIOC_SETELMSTAT, (caddr_t) &o) < 0) { |