From 27e9a654507ef3d7d144555f3afbbfaa398ee86d Mon Sep 17 00:00:00 2001 From: mav Date: Fri, 7 Oct 2016 01:33:03 +0000 Subject: [PATCH] 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. git-svn-id: svn://svn.freebsd.org/base/stable/10@306797 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- usr.sbin/sesutil/sesutil.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/usr.sbin/sesutil/sesutil.c b/usr.sbin/sesutil/sesutil.c index 0f04c0746..d55cd3bac 100644 --- a/usr.sbin/sesutil/sesutil.c +++ b/usr.sbin/sesutil/sesutil.c @@ -119,10 +119,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) { -- 2.45.0