git: 5b8c67766471 - stable/13 - sesutil: Fix status checking
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 18 Feb 2022 14:52:24 UTC
The branch stable/13 has been updated by trasz:
URL: https://cgit.FreeBSD.org/src/commit/?id=5b8c67766471038040ffd9e89df969f859affdc5
commit 5b8c67766471038040ffd9e89df969f859affdc5
Author: Edward Tomasz Napierala <trasz@FreeBSD.org>
AuthorDate: 2021-07-21 09:14:21 +0000
Commit: Edward Tomasz Napierala <trasz@FreeBSD.org>
CommitDate: 2022-02-14 18:42:44 +0000
sesutil: Fix status checking
Previously we would display "OK, Swapped" for swapped disks,
instead of the usual disk size.
Reviewed By: allanjude
Differential Revision: https://reviews.freebsd.org/D31219
(cherry picked from commit a1571967135255d2ea5256a4721e6f9909f291e5)
---
usr.sbin/sesutil/sesutil.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/usr.sbin/sesutil/sesutil.c b/usr.sbin/sesutil/sesutil.c
index 0dd02021b374..33303235a33c 100644
--- a/usr.sbin/sesutil/sesutil.c
+++ b/usr.sbin/sesutil/sesutil.c
@@ -651,7 +651,7 @@ show_device(int fd, int elm_idx, encioc_elm_status_t e_status, encioc_elm_desc_t
xo_emit("{e:model/%s}", model ? model : "");
xo_emit("{d:serial/%-20s} ", serial != NULL ? serial : "-");
xo_emit("{e:serial/%s}", serial != NULL ? serial : "");
- if (e_status.cstat[0] == SES_OBJSTAT_OK && size >= 0) {
+ if ((e_status.cstat[0] & 0xf) == SES_OBJSTAT_OK && size >= 0) {
xo_emit("{h,hn-1000:size/%ld}{e:status/%s}",
size, scode2ascii(e_status.cstat[0]));
} else {