diff options
author | Eric Andersen <andersen@codepoet.org> | 2003-08-08 20:04:56 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2003-08-08 20:04:56 +0000 |
commit | 99a75d13762f5a090058d4840c7afe6ee4bf5966 (patch) | |
tree | 6e5284795f8b8ffa1f516ca410364a004e193afb /util-linux | |
parent | de6a6ae876ce7a501f8d9a948a59163b83a3766e (diff) | |
download | busybox-w32-99a75d13762f5a090058d4840c7afe6ee4bf5966.tar.gz busybox-w32-99a75d13762f5a090058d4840c7afe6ee4bf5966.tar.bz2 busybox-w32-99a75d13762f5a090058d4840c7afe6ee4bf5966.zip |
Patch from Kent Robotti to being fdisk in sync with v2.12 final.
Diffstat (limited to 'util-linux')
-rw-r--r-- | util-linux/fdisk.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c index a8e1ac857..02c5c10ff 100644 --- a/util-linux/fdisk.c +++ b/util-linux/fdisk.c | |||
@@ -10,7 +10,7 @@ | |||
10 | * Vladimir Oleynik <dzo@simtreas.ru> 2001,2002 Busybox port | 10 | * Vladimir Oleynik <dzo@simtreas.ru> 2001,2002 Busybox port |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #define UTIL_LINUX_VERSION "2.12pre" | 13 | #define UTIL_LINUX_VERSION "2.12" |
14 | 14 | ||
15 | #define PROC_PARTITIONS "/proc/partitions" | 15 | #define PROC_PARTITIONS "/proc/partitions" |
16 | 16 | ||
@@ -1925,11 +1925,9 @@ sgi_get_swappartition(void) | |||
1925 | 1925 | ||
1926 | static void | 1926 | static void |
1927 | sgi_list_table(int xtra) { | 1927 | sgi_list_table(int xtra) { |
1928 | int i, w; | 1928 | int i, w, wd; |
1929 | int kpi = 0; /* kernel partition ID */ | 1929 | int kpi = 0; /* kernel partition ID */ |
1930 | 1930 | ||
1931 | w = strlen(disk_device); | ||
1932 | |||
1933 | if(xtra) { | 1931 | if(xtra) { |
1934 | printf(_("\nDisk %s (SGI disk label): %d heads, %d sectors\n" | 1932 | printf(_("\nDisk %s (SGI disk label): %d heads, %d sectors\n" |
1935 | "%d cylinders, %d physical cylinders\n" | 1933 | "%d cylinders, %d physical cylinders\n" |
@@ -1949,9 +1947,15 @@ sgi_list_table(int xtra) { | |||
1949 | disk_device, heads, sectors, cylinders, | 1947 | disk_device, heads, sectors, cylinders, |
1950 | str_units(PLURAL), units_per_sector ); | 1948 | str_units(PLURAL), units_per_sector ); |
1951 | } | 1949 | } |
1950 | |||
1951 | w = strlen(disk_device); | ||
1952 | wd = strlen(_("Device")); | ||
1953 | if (w < wd) | ||
1954 | w = wd; | ||
1955 | |||
1952 | printf(_("----- partitions -----\n" | 1956 | printf(_("----- partitions -----\n" |
1953 | "Pt# %*s Info Start End Sectors Id System\n"), | 1957 | "Pt# %*s Info Start End Sectors Id System\n"), |
1954 | w + 1, _("Device")); | 1958 | w + 2, _("Device")); |
1955 | for (i = 0 ; i < partitions; i++) { | 1959 | for (i = 0 ; i < partitions; i++) { |
1956 | if( sgi_get_num_sectors(i) || debug ) { | 1960 | if( sgi_get_num_sectors(i) || debug ) { |
1957 | uint32_t start = sgi_get_start_sector(i); | 1961 | uint32_t start = sgi_get_start_sector(i); |
@@ -1960,7 +1964,7 @@ sgi_list_table(int xtra) { | |||
1960 | printf( | 1964 | printf( |
1961 | "%2d: %s %4s %9ld %9ld %9ld %2x %s\n", | 1965 | "%2d: %s %4s %9ld %9ld %9ld %2x %s\n", |
1962 | /* fdisk part number */ i+1, | 1966 | /* fdisk part number */ i+1, |
1963 | /* device */ partname(disk_device, kpi, w+2), | 1967 | /* device */ partname(disk_device, kpi, w+3), |
1964 | /* flags */ (sgi_get_swappartition() == i) ? "swap" : | 1968 | /* flags */ (sgi_get_swappartition() == i) ? "swap" : |
1965 | /* flags */ (sgi_get_bootpartition() == i) ? "boot" : " ", | 1969 | /* flags */ (sgi_get_bootpartition() == i) ? "boot" : " ", |
1966 | /* start */ (long) scround(start), | 1970 | /* start */ (long) scround(start), |