Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Sep 2016 20:35:13 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r306528 - head/usr.sbin/sesutil
Message-ID:  <201609302035.u8UKZDHf026983@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Fri Sep 30 20:35:12 2016
New Revision: 306528
URL: https://svnweb.freebsd.org/changeset/base/306528

Log:
  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.
  
  MFC after:	1 week

Modified:
  head/usr.sbin/sesutil/sesutil.c

Modified: head/usr.sbin/sesutil/sesutil.c
==============================================================================
--- head/usr.sbin/sesutil/sesutil.c	Fri Sep 30 20:20:07 2016	(r306527)
+++ head/usr.sbin/sesutil/sesutil.c	Fri Sep 30 20:35:12 2016	(r306528)
@@ -118,10 +118,16 @@ do_led(int fd, unsigned int idx, bool on
 		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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201609302035.u8UKZDHf026983>