Module Name:    src
Committed By:   christos
Date:           Fri Dec  2 15:21:15 UTC 2011

Modified Files:
        src/sbin/fdisk: fdisk.c

Log Message:
Also ignore out of space conditions for -I so we can create overlapping
partitions on a full disk. Document and add it to the options.


To generate a diff of this commit:
cvs rdiff -u -r1.137 -r1.138 src/sbin/fdisk/fdisk.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/fdisk/fdisk.c
diff -u src/sbin/fdisk/fdisk.c:1.137 src/sbin/fdisk/fdisk.c:1.138
--- src/sbin/fdisk/fdisk.c:1.137	Thu Dec  1 23:05:20 2011
+++ src/sbin/fdisk/fdisk.c	Fri Dec  2 10:21:15 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fdisk.c,v 1.137 2011/12/02 04:05:20 enami Exp $ */
+/*	$NetBSD: fdisk.c,v 1.138 2011/12/02 15:21:15 christos Exp $ */
 
 /*
  * Mach Operating System
@@ -39,7 +39,7 @@
 #include <sys/cdefs.h>
 
 #ifndef lint
-__RCSID("$NetBSD: fdisk.c,v 1.137 2011/12/02 04:05:20 enami Exp $");
+__RCSID("$NetBSD: fdisk.c,v 1.138 2011/12/02 15:21:15 christos Exp $");
 #endif /* not lint */
 
 #define MBRPTYPENAMES
@@ -155,7 +155,7 @@ static char *boot_path = NULL;			/* name
 #define BOOTSEL_OPTIONS	
 #define change_part(e, p, id, st, sz, bm) change__part(e, p, id, st, sz)
 #endif
-#define OPTIONS	BOOTSEL_OPTIONS "0123FSafiluvA:b:c:E:r:s:w:"
+#define OPTIONS	BOOTSEL_OPTIONS "0123FSafiIluvA:b:c:E:r:s:w:"
 
 /*
  * Disk geometry and partition alignment.
@@ -615,6 +615,7 @@ usage(void)
 		"\t-a change active partition\n"
 		"\t-f force - not interactive\n"
 		"\t-i initialise MBR code\n"
+		"\t-I ignore errors about no space or overlapping partitions\n"
 		"\t-l list partition types\n"
 		"\t-u update partition data\n"
 		"\t-v verbose output, -v -v more verbose still\n"
@@ -2065,7 +2066,7 @@ change_part(int extended, int part, int 
 					p = -1;
 				}
 			}
-			if (start >= disksectors) {
+			if (start >= disksectors && !I_flag) {
 				printf("No free space\n");
 				return 0;
 			}

Reply via email to