diff options
author | mav <mav@FreeBSD.org> | 2012-11-06 01:29:26 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2012-11-06 01:29:26 +0000 |
commit | 48bd765ad7d8c6dff3f79738388d8075e9dc328d (patch) | |
tree | c8e562d7abf6bfad41684dd63d3fc4448501c608 | |
parent | 602e4e5a50796e99fe433474238c7df0f1573548 (diff) | |
download | FreeBSD-src-48bd765ad7d8c6dff3f79738388d8075e9dc328d.zip FreeBSD-src-48bd765ad7d8c6dff3f79738388d8075e9dc328d.tar.gz |
Decode common state bits in getencstat output.
-rw-r--r-- | share/examples/ses/srcs/eltsub.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/share/examples/ses/srcs/eltsub.c b/share/examples/ses/srcs/eltsub.c index cc976b6..c664895 100644 --- a/share/examples/ses/srcs/eltsub.c +++ b/share/examples/ses/srcs/eltsub.c @@ -180,7 +180,11 @@ stat2ascii(int eletype __unused, u_char *cstat) 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); } |