git: 732c8d2a1a0e - main - sockstat: improve consistency

From: Michael Tuexen <tuexen_at_FreeBSD.org>
Date: Sun, 23 Aug 2026 20:12:11 UTC
The branch main has been updated by tuexen:

URL: https://cgit.FreeBSD.org/src/commit/?id=732c8d2a1a0e169bad1c02b1e54a4306861bde4a

commit 732c8d2a1a0e169bad1c02b1e54a4306861bde4a
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2026-08-23 19:55:51 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2026-08-23 20:11:24 +0000

    sockstat: improve consistency
    
    Include the entries of the BBLOG STATE column in the computation
    of the column width as done also for other columns.
    Also set first to falso only when needed.
    
    MFC after:      3 days
    MFC to:         stable/15
    MFC to:         stable/14
    Sponsored by:   Netflix, Inc.
---
 usr.bin/sockstat/main.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/usr.bin/sockstat/main.c b/usr.bin/sockstat/main.c
index 7acfdc08b0a6..d448f7fcf005 100644
--- a/usr.bin/sockstat/main.c
+++ b/usr.bin/sockstat/main.c
@@ -1312,12 +1312,16 @@ calculate_sock_column_widths(struct col_widths *cw, struct sock *s)
 				len = strlen(s->cc);
 				cw->cc = MAX(cw->cc, len);
 			}
+			if (opt_b && s->proto == &protos[TCP]) {
+				len = strlen(bblog_state(s->bblog_state));
+				cw->bblog_state = MAX(cw->bblog_state, len);
+			}
+			first = false;
 		}
 		if (laddr != NULL)
 			laddr = laddr->next;
 		if (faddr != NULL)
 			faddr = faddr->next;
-		first = false;
 	}
 }