summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1999-03-13 19:42:41 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1999-03-13 19:42:41 +0000
commit19f2165b0d65ff06fa790cc078ee1af1b90beff6 (patch)
tree75507475d5d88c7d705ed27125c42154c0ba28e5
parentc1b29f887a2f6d3708c90978e6f83331ae5238c2 (diff)
Allow user to delete partitions outside the openbsd part of the disk
-rw-r--r--sbin/disklabel/editor.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c
index f61d81a0809..7b4d7f3ae0c 100644
--- a/sbin/disklabel/editor.c
+++ b/sbin/disklabel/editor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: editor.c,v 1.47 1999/03/13 19:07:37 millert Exp $ */
+/* $OpenBSD: editor.c,v 1.48 1999/03/13 19:42:40 millert Exp $ */
/*
* Copyright (c) 1997-1999 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -28,7 +28,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: editor.c,v 1.47 1999/03/13 19:07:37 millert Exp $";
+static char rcsid[] = "$OpenBSD: editor.c,v 1.48 1999/03/13 19:42:40 millert Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -892,15 +892,11 @@ editor_delete(lp, freep, p)
"You may not delete the 'c' partition. The 'c' partition must exist and\n"
"should span the entire disk. By default it is of type 'unused' and so\n"
"does not take up any space.\n", stderr);
- else if (lp->d_partitions[c].p_offset >= ending_sector ||
- lp->d_partitions[c].p_offset < starting_sector)
- fprintf(stderr, "The OpenBSD portion of the disk ends at sector"
- " %u.\nYou can't remove a partition outside the OpenBSD "
- "part of the disk. You can use the 'b' command to change "
- "the size of the OpenBSD portion.\n", ending_sector);
else {
/* Update free sector count. */
- if (lp->d_partitions[c].p_fstype != FS_UNUSED &&
+ if (lp->d_partitions[c].p_offset < ending_sector &&
+ lp->d_partitions[c].p_offset >= starting_sector &&
+ lp->d_partitions[c].p_fstype != FS_UNUSED &&
lp->d_partitions[c].p_fstype != FS_BOOT &&
lp->d_partitions[c].p_size != 0)
*freep += lp->d_partitions[c].p_size;