summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sesutil/sesutil.c
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-10-12 11:41:26 -0300
committerRenato Botelho <renato@netgate.com>2016-10-12 11:41:26 -0300
commitcb642130dfc50717bb970a104c44aa7690930a38 (patch)
treec67f108534217a209198c6b201949ecc73acaba3 /usr.sbin/sesutil/sesutil.c
parent5dd7ab172435dc99e1abc1f7d73fd5e720050bbc (diff)
parentcd04fbc5e631c6b3e80a14eb7044c3be35fba2d2 (diff)
downloadFreeBSD-src-cb642130dfc50717bb970a104c44aa7690930a38.zip
FreeBSD-src-cb642130dfc50717bb970a104c44aa7690930a38.tar.gz
Merge remote-tracking branch 'origin/stable/11' into devel-11
Diffstat (limited to 'usr.sbin/sesutil/sesutil.c')
-rw-r--r--usr.sbin/sesutil/sesutil.c12
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) {
OpenPOWER on IntegriCloud