zpool: things get messy with 0 columns

zpool iostat with terminal reporting 0 columns will print out
a very long line. Use columns 80 when query reports 0.

Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Toomas Soome <[email protected]>
Closes #19051
This commit is contained in:
Toomas Soome authored and GitHub committed 2026-09-04 12:29:49 -07:00
1 parent 588012797f
commit ba524e0d7c
1 file changed
+1 -1
+1 -1
View File
@@ -5872,7 +5872,7 @@ get_columns(void)
if (isatty(STDOUT_FILENO)) {
error = ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws);
if (error == 0)
if (error == 0 && ws.ws_col > 0)
columns = ws.ws_col;
} else {
columns = 999;