Date: Tue, 6 Nov 2012 01:29:26 +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: r242647 - head/share/examples/ses/srcs Message-ID: <201211060129.qA61TQpd041955@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Tue Nov 6 01:29:26 2012 New Revision: 242647 URL: http://svnweb.freebsd.org/changeset/base/242647 Log: Decode common state bits in getencstat output. Modified: head/share/examples/ses/srcs/eltsub.c Modified: head/share/examples/ses/srcs/eltsub.c ============================================================================== --- head/share/examples/ses/srcs/eltsub.c Tue Nov 6 01:18:53 2012 (r242646) +++ head/share/examples/ses/srcs/eltsub.c Tue Nov 6 01:29:26 2012 (r242647) @@ -180,7 +180,11 @@ stat2ascii(int eletype __unused, u_char static char ebuf[256], *scode; scode = scode2ascii(cstat[0]); - sprintf(ebuf, "status: %s (0x%02x 0x%02x 0x%02x 0x%02x)", - scode, cstat[0], cstat[1], cstat[2], cstat[3]); + sprintf(ebuf, "status: %s%s%s%s (0x%02x 0x%02x 0x%02x 0x%02x)", + scode, + (cstat[0] & 0x40) ? ", Prd.Fail" : "", + (cstat[0] & 0x20) ? ", Disabled" : "", + (cstat[0] & 0x10) ? ", Swapped" : "", + cstat[0], cstat[1], cstat[2], cstat[3]); return (ebuf); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211060129.qA61TQpd041955>