summaryrefslogtreecommitdiff
path: root/sbin/disklabel
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1998-07-29 18:47:13 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1998-07-29 18:47:13 +0000
commit0ca51f9b8a3c5dc4759ce95bdb31fb57b3757f79 (patch)
tree6f2e41e08265ecf7afbbdf48c32e6ee43153269d /sbin/disklabel
parentb4ee90829c5a0ea5170cdcd8e2c52267b2b74e95 (diff)
when changing a partition from unknown to 4.2BSD, provide sane defaults for fsize, bsize, cpg
Diffstat (limited to 'sbin/disklabel')
-rw-r--r--sbin/disklabel/editor.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c
index 4ab0770d981..322c1a81aa7 100644
--- a/sbin/disklabel/editor.c
+++ b/sbin/disklabel/editor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: editor.c,v 1.41 1998/07/26 17:40:38 millert Exp $ */
+/* $OpenBSD: editor.c,v 1.42 1998/07/29 18:47:12 millert Exp $ */
/*
* Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -28,7 +28,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: editor.c,v 1.41 1998/07/26 17:40:38 millert Exp $";
+static char rcsid[] = "$OpenBSD: editor.c,v 1.42 1998/07/29 18:47:12 millert Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -788,7 +788,7 @@ getoff2:
for (;;) {
ui = getuint(lp, partno, "fragment size",
"Size of fs block fragments. Usually 1024 or 512.",
- pp->p_fsize, 1024, 0);
+ pp->p_fsize ? pp->p_fsize : 1024, 1024, 0);
if (ui == UINT_MAX - 1) {
fputs("Command aborted\n", stderr);
*pp = origpart; /* undo changes */
@@ -806,8 +806,8 @@ getoff2:
for (; pp->p_fsize > 0;) {
ui = getuint(lp, partno, "block size",
"Size of filesystem blocks. Usually 8192 or 4096.",
- pp->p_fsize * pp->p_frag, pp->p_fsize * pp->p_frag,
- 0);
+ pp->p_frag ? pp->p_fsize * pp->p_frag : 8192,
+ 8192, 0);
/* sanity check */
if (ui == UINT_MAX - 1) {
@@ -831,8 +831,8 @@ getoff2:
for (;;) {
ui = getuint(lp, partno, "cpg",
"Number of filesystem cylinders per group."
- " Usually 16 or 8.", pp->p_cpg, pp->p_cpg,
- 0);
+ " Usually 16 or 8.",
+ pp->p_cpg ? pp->p_cpg : 16, 16, 0);
if (ui == UINT_MAX - 1) {
fputs("Command aborted\n", stderr);
*pp = origpart; /* undo changes */