Module Name: src
Committed By: martin
Date: Wed Sep 11 16:39:43 UTC 2024
Modified Files:
src/sbin/newfs [netbsd-10]: mkfs.c
Log Message:
Pull up following revision(s) (requested by rin in ticket #835):
sbin/newfs/mkfs.c: revision 1.136
if the window size works but is 0, assume it didn't work and use 80.
To generate a diff of this commit:
cvs rdiff -u -r1.132.2.1 -r1.132.2.2 src/sbin/newfs/mkfs.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sbin/newfs/mkfs.c
diff -u src/sbin/newfs/mkfs.c:1.132.2.1 src/sbin/newfs/mkfs.c:1.132.2.2
--- src/sbin/newfs/mkfs.c:1.132.2.1 Sat May 13 11:51:14 2023
+++ src/sbin/newfs/mkfs.c Wed Sep 11 16:39:43 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: mkfs.c,v 1.132.2.1 2023/05/13 11:51:14 martin Exp $ */
+/* $NetBSD: mkfs.c,v 1.132.2.2 2024/09/11 16:39:43 martin Exp $ */
/*
* Copyright (c) 1980, 1989, 1993
@@ -73,7 +73,7 @@
#if 0
static char sccsid[] = "@(#)mkfs.c 8.11 (Berkeley) 5/3/95";
#else
-__RCSID("$NetBSD: mkfs.c,v 1.132.2.1 2023/05/13 11:51:14 martin Exp $");
+__RCSID("$NetBSD: mkfs.c,v 1.132.2.2 2024/09/11 16:39:43 martin Exp $");
#endif
#endif /* not lint */
@@ -672,7 +672,8 @@ mkfs(const char *fsys, int fi, int fo,
fld_width = verbosity < 4 ? 1 : snprintf(NULL, 0, "%" PRIu64,
(uint64_t)FFS_FSBTODB(&sblock, cgsblock(&sblock, sblock.fs_ncg-1)));
/* Get terminal width */
- if (ioctl(fileno(stdout), TIOCGWINSZ, &winsize) == 0)
+ if (ioctl(fileno(stdout), TIOCGWINSZ, &winsize) == 0 &&
+ winsize.ws_col != 0)
max_cols = winsize.ws_col;
else
max_cols = 80;