aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-05-19 10:49:17 +0000
committerEric Andersen <andersen@codepoet.org>2004-05-19 10:49:17 +0000
commit84bdea8cb246c2cb3e28724bab253db12e51884a (patch)
tree9a6c58dffb8c6c7569462272f5aa8bcca7ffb5ee
parent5c9323f4e6d5e1c619ff3ea0b30bf5e8e3a2b87a (diff)
downloadbusybox-w32-84bdea8cb246c2cb3e28724bab253db12e51884a.tar.gz
busybox-w32-84bdea8cb246c2cb3e28724bab253db12e51884a.tar.bz2
busybox-w32-84bdea8cb246c2cb3e28724bab253db12e51884a.zip
Erik,
>http://busybox.net/cgi-bin/cvsweb/busybox/util-linux/fdisk.c?r1=1.22&r2=1.23&diff_format=u Its hack for "force" ;-) If to return the previous version of a Config.in http://busybox.net/cgi-bin/cvsweb/busybox/util-linux/Config.in?r1=1.12&r2=1.13 and to apply last patch, then I shall calm down. ;-) (OOPS, last patch have autocorrected from my editor begins spaces to tabs and removed spaces from empty lines too). --w vodz
-rw-r--r--util-linux/Config.in8
-rw-r--r--util-linux/fdisk.c18
2 files changed, 18 insertions, 8 deletions
diff --git a/util-linux/Config.in b/util-linux/Config.in
index 5b8ed1f0b..6972591cc 100644
--- a/util-linux/Config.in
+++ b/util-linux/Config.in
@@ -74,6 +74,14 @@ config CONFIG_FDISK
74 can be used to list and edit the set of partitions or BSD style 74 can be used to list and edit the set of partitions or BSD style
75 'disk slices' that are defined on a hard drive. 75 'disk slices' that are defined on a hard drive.
76 76
77config FDISK_SUPPORT_LARGE_DISKS
78 bool " support over 4GB disks"
79 default y
80 depends on CONFIG_FDISK
81 select CONFIG_LFS
82 help
83 Enable this option to support large disks > 4GB.
84
77config CONFIG_FEATURE_FDISK_WRITABLE 85config CONFIG_FEATURE_FDISK_WRITABLE
78 bool " Write support" 86 bool " Write support"
79 default y 87 default y
diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c
index a2c03ce79..5e7e79c65 100644
--- a/util-linux/fdisk.c
+++ b/util-linux/fdisk.c
@@ -19,7 +19,9 @@
19 * to instead really use 64 bit interfaces, at least for 19 * to instead really use 64 bit interfaces, at least for
20 * glibc and uClibc... */ 20 * glibc and uClibc... */
21#ifndef __USE_FILE_OFFSET64 21#ifndef __USE_FILE_OFFSET64
22# define __USE_FILE_OFFSET64 1 22# ifdef FDISK_SUPPORT_LARGE_DISKS
23# define __USE_FILE_OFFSET64 1
24# endif
23#endif 25#endif
24 26
25#include <sys/types.h> 27#include <sys/types.h>
@@ -4206,7 +4208,7 @@ read_int(uint low, uint dflt, uint high, uint base, char *mesg)
4206 && *line_ptr != '-' && *line_ptr != '+') 4208 && *line_ptr != '-' && *line_ptr != '+')
4207 continue; 4209 continue;
4208 4210
4209 if (*line_ptr == '+' || *line_ptr == '-') { 4211 if (*line_ptr == '+' || *line_ptr == '-') {
4210 int minus = (*line_ptr == '-'); 4212 int minus = (*line_ptr == '-');
4211 int absolute = 0; 4213 int absolute = 0;
4212 4214
@@ -4214,7 +4216,7 @@ read_int(uint low, uint dflt, uint high, uint base, char *mesg)
4214 4216
4215 while (isdigit(*++line_ptr)) 4217 while (isdigit(*++line_ptr))
4216 use_default = 0; 4218 use_default = 0;
4217 4219
4218 switch (*line_ptr) { 4220 switch (*line_ptr) {
4219 case 'c': 4221 case 'c':
4220 case 'C': 4222 case 'C':
@@ -4244,14 +4246,14 @@ read_int(uint low, uint dflt, uint high, uint base, char *mesg)
4244 4246
4245 bytes = (unsigned long long) i * absolute; 4247 bytes = (unsigned long long) i * absolute;
4246 unit = sector_size * units_per_sector; 4248 unit = sector_size * units_per_sector;
4247 bytes += unit/2; /* round */ 4249 bytes += unit/2; /* round */
4248 bytes /= unit; 4250 bytes /= unit;
4249 i = bytes; 4251 i = bytes;
4250 } 4252 }
4251 if (minus) 4253 if (minus)
4252 i = -i; 4254 i = -i;
4253 i += base; 4255 i += base;
4254 } else { 4256 } else {
4255 i = atoi(line_ptr); 4257 i = atoi(line_ptr);
4256 while (isdigit(*line_ptr)) { 4258 while (isdigit(*line_ptr)) {
4257 line_ptr++; 4259 line_ptr++;
@@ -4613,7 +4615,7 @@ static void check_consistency(const struct partition *p, int partition) {
4613 4615
4614/* Ending on cylinder boundary? */ 4616/* Ending on cylinder boundary? */
4615 if (peh != (heads - 1) || pes != sectors) { 4617 if (peh != (heads - 1) || pes != sectors) {
4616 printf(_("Partition %i does not end on cylinder boundary.\n"), 4618 printf(_("Partition %i does not end on cylinder boundary.\n"),
4617 partition + 1); 4619 partition + 1);
4618#if 0 4620#if 0
4619 printf(_(" phys=(%d, %d, %d) "), pec, peh, pes); 4621 printf(_(" phys=(%d, %d, %d) "), pec, peh, pes);
@@ -5186,8 +5188,8 @@ new_partition(void) {
5186 free_primary += !ptes[i].part_table->sys_ind; 5188 free_primary += !ptes[i].part_table->sys_ind;
5187 5189
5188 if (!free_primary && partitions >= MAXIMUM_PARTS) { 5190 if (!free_primary && partitions >= MAXIMUM_PARTS) {
5189 printf(_("The maximum number of partitions has been created\n")); 5191 printf(_("The maximum number of partitions has been created\n"));
5190 return; 5192 return;
5191 } 5193 }
5192 5194
5193 if (!free_primary) { 5195 if (!free_primary) {