summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1998-05-07 06:22:21 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1998-05-07 06:22:21 +0000
commitfb579ced8408288145ef3614c50ce882eb16efb1 (patch)
tree2660f33a8592b643b69f0f5afda70a6ec154c41d
parentb6ac988dc8c84187ccd6e257758a3f1d8a305bed (diff)
let user set d_interleave, and force it to be >= 1
-rw-r--r--sbin/disklabel/editor.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c
index 0bbb74f6ba9..a8168b41201 100644
--- a/sbin/disklabel/editor.c
+++ b/sbin/disklabel/editor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: editor.c,v 1.34 1998/04/14 20:02:48 millert Exp $ */
+/* $OpenBSD: editor.c,v 1.35 1998/05/07 06:22:20 millert Exp $ */
/*
* Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -31,7 +31,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: editor.c,v 1.34 1998/04/14 20:02:48 millert Exp $";
+static char rcsid[] = "$OpenBSD: editor.c,v 1.35 1998/05/07 06:22:20 millert Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -160,6 +160,10 @@ editor(lp, f)
label.d_sbsize = SBSIZE;
}
+ /* Interleave must be >= 1 */
+ if (label.d_interleave == 0)
+ label.d_interleave = 1;
+
puts("\nInitial label editor (enter '?' for help at any prompt)");
lastlabel = label;
for (;;) {
@@ -1528,6 +1532,22 @@ edit_parms(lp, freep)
break;
}
lp->d_rpm = ui;
+
+ /* interleave */
+ for (;;) {
+ ui = getuint(lp, 0, "interleave",
+ "The physical sector interleave, set when formatting. Almost always 1.",
+ lp->d_interleave, lp->d_interleave, 0);
+ if (ui == UINT_MAX - 1) {
+ fputs("Command aborted\n", stderr);
+ *lp = oldlabel; /* undo damage */
+ return;
+ } else if (ui == UINT_MAX || ui == 0)
+ fputs("Invalid entry\n", stderr);
+ else
+ break;
+ }
+ lp->d_interleave = ui;
}
struct partition **