diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-10-14 16:16:03 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-10-14 16:16:03 +0000 |
commit | efeed5ed28a04e1353f063daa60ca04b37f681ec (patch) | |
tree | 9845ccf7b120b18f0dbebdc720275ab82c42afd5 | |
parent | 3544ae60047f9bb94d5ce8c699c9c2b444a73f35 (diff) | |
download | busybox-w32-efeed5ed28a04e1353f063daa60ca04b37f681ec.tar.gz busybox-w32-efeed5ed28a04e1353f063daa60ca04b37f681ec.tar.bz2 busybox-w32-efeed5ed28a04e1353f063daa60ca04b37f681ec.zip |
fdisk: compilation fix
-rw-r--r-- | util-linux/fdisk.c | 82 | ||||
-rw-r--r-- | util-linux/fdisk_osf.c | 2 | ||||
-rw-r--r-- | util-linux/fdisk_sgi.c | 2 |
3 files changed, 49 insertions, 37 deletions
diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c index ab8946744..d5edaaa00 100644 --- a/util-linux/fdisk.c +++ b/util-linux/fdisk.c | |||
@@ -131,25 +131,37 @@ enum label_type { | |||
131 | label_dos, label_sun, label_sgi, label_aix, label_osf | 131 | label_dos, label_sun, label_sgi, label_aix, label_osf |
132 | }; | 132 | }; |
133 | #define LABEL_IS_DOS (label_dos == current_label_type) | 133 | #define LABEL_IS_DOS (label_dos == current_label_type) |
134 | |||
134 | #ifdef CONFIG_FEATURE_SUN_LABEL | 135 | #ifdef CONFIG_FEATURE_SUN_LABEL |
135 | #define LABEL_IS_SUN (label_sun == current_label_type) | 136 | #define LABEL_IS_SUN (label_sun == current_label_type) |
137 | #define STATIC_SUN static | ||
136 | #else | 138 | #else |
137 | #define LABEL_IS_SUN 0 | 139 | #define LABEL_IS_SUN 0 |
140 | #define STATIC_SUN extern | ||
138 | #endif | 141 | #endif |
142 | |||
139 | #ifdef CONFIG_FEATURE_SGI_LABEL | 143 | #ifdef CONFIG_FEATURE_SGI_LABEL |
140 | #define LABEL_IS_SGI (label_sgi == current_label_type) | 144 | #define LABEL_IS_SGI (label_sgi == current_label_type) |
145 | #define STATIC_SGI static | ||
141 | #else | 146 | #else |
142 | #define LABEL_IS_SGI 0 | 147 | #define LABEL_IS_SGI 0 |
148 | #define STATIC_SGI extern | ||
143 | #endif | 149 | #endif |
150 | |||
144 | #ifdef CONFIG_FEATURE_AIX_LABEL | 151 | #ifdef CONFIG_FEATURE_AIX_LABEL |
145 | #define LABEL_IS_AIX (label_aix == current_label_type) | 152 | #define LABEL_IS_AIX (label_aix == current_label_type) |
153 | #define STATIC_AIX static | ||
146 | #else | 154 | #else |
147 | #define LABEL_IS_AIX 0 | 155 | #define LABEL_IS_AIX 0 |
156 | #define STATIC_AIX extern | ||
148 | #endif | 157 | #endif |
158 | |||
149 | #ifdef CONFIG_FEATURE_OSF_LABEL | 159 | #ifdef CONFIG_FEATURE_OSF_LABEL |
150 | #define LABEL_IS_OSF (label_osf == current_label_type) | 160 | #define LABEL_IS_OSF (label_osf == current_label_type) |
161 | #define STATIC_OSF static | ||
151 | #else | 162 | #else |
152 | #define LABEL_IS_OSF 0 | 163 | #define LABEL_IS_OSF 0 |
164 | #define STATIC_OSF extern | ||
153 | #endif | 165 | #endif |
154 | 166 | ||
155 | enum action { fdisk, require, try_only, create_empty_dos, create_empty_sun }; | 167 | enum action { fdisk, require, try_only, create_empty_dos, create_empty_sun }; |
@@ -317,21 +329,6 @@ read_hex(const struct systypes *sys) | |||
317 | } | 329 | } |
318 | #endif /* CONFIG_FEATURE_FDISK_WRITABLE */ | 330 | #endif /* CONFIG_FEATURE_FDISK_WRITABLE */ |
319 | 331 | ||
320 | static const struct systypes sgi_sys_types[]; | ||
321 | static unsigned int sgi_get_num_sectors(int i); | ||
322 | static int sgi_get_sysid(int i); | ||
323 | static void sgi_delete_partition(int i); | ||
324 | static void sgi_change_sysid(int i, int sys); | ||
325 | static void sgi_list_table(int xtra); | ||
326 | static void sgi_set_xcyl(void); | ||
327 | static int verify_sgi(int verbose); | ||
328 | static void sgi_add_partition(int n, int sys); | ||
329 | static void sgi_set_swappartition(int i); | ||
330 | static const char *sgi_get_bootfile(void); | ||
331 | static void sgi_set_bootfile(const char* aFile); | ||
332 | static void create_sgiinfo(void); | ||
333 | static void sgi_write_table(void); | ||
334 | static void sgi_set_bootpartition(int i); | ||
335 | #include "fdisk_aix.c" | 332 | #include "fdisk_aix.c" |
336 | 333 | ||
337 | typedef struct { | 334 | typedef struct { |
@@ -364,8 +361,8 @@ typedef struct { | |||
364 | #define sunlabel ((sun_partition *)MBRbuffer) | 361 | #define sunlabel ((sun_partition *)MBRbuffer) |
365 | #define SUNOS_SWAP 3 | 362 | #define SUNOS_SWAP 3 |
366 | #define SUN_WHOLE_DISK 5 | 363 | #define SUN_WHOLE_DISK 5 |
367 | static void bselect(void); | 364 | STATIC_OSF void bsd_select(void); |
368 | static void xbsd_print_disklabel(int); | 365 | STATIC_OSF void xbsd_print_disklabel(int); |
369 | #include "fdisk_osf.c" | 366 | #include "fdisk_osf.c" |
370 | 367 | ||
371 | #define SGI_VOLHDR 0x00 | 368 | #define SGI_VOLHDR 0x00 |
@@ -398,23 +395,39 @@ __swap32(uint32_t x) | |||
398 | } | 395 | } |
399 | #endif | 396 | #endif |
400 | 397 | ||
398 | STATIC_SGI const struct systypes sgi_sys_types[]; | ||
399 | STATIC_SGI unsigned int sgi_get_num_sectors(int i); | ||
400 | STATIC_SGI int sgi_get_sysid(int i); | ||
401 | STATIC_SGI void sgi_delete_partition(int i); | ||
402 | STATIC_SGI void sgi_change_sysid(int i, int sys); | ||
403 | STATIC_SGI void sgi_list_table(int xtra); | ||
404 | STATIC_SGI void sgi_set_xcyl(void); | ||
405 | STATIC_SGI int verify_sgi(int verbose); | ||
406 | STATIC_SGI void sgi_add_partition(int n, int sys); | ||
407 | STATIC_SGI void sgi_set_swappartition(int i); | ||
408 | STATIC_SGI const char *sgi_get_bootfile(void); | ||
409 | STATIC_SGI void sgi_set_bootfile(const char* aFile); | ||
410 | STATIC_SGI void create_sgiinfo(void); | ||
411 | STATIC_SGI void sgi_write_table(void); | ||
412 | STATIC_SGI void sgi_set_bootpartition(int i); | ||
413 | |||
401 | #include "fdisk_sgi.c" | 414 | #include "fdisk_sgi.c" |
402 | 415 | ||
403 | static const struct systypes sun_sys_types[]; | 416 | STATIC_SUN const struct systypes sun_sys_types[]; |
404 | static void sun_delete_partition(int i); | 417 | STATIC_SUN void sun_delete_partition(int i); |
405 | static void sun_change_sysid(int i, int sys); | 418 | STATIC_SUN void sun_change_sysid(int i, int sys); |
406 | static void sun_list_table(int xtra); | 419 | STATIC_SUN void sun_list_table(int xtra); |
407 | static void sun_set_xcyl(void); | 420 | STATIC_SUN void sun_set_xcyl(void); |
408 | static void add_sun_partition(int n, int sys); | 421 | STATIC_SUN void add_sun_partition(int n, int sys); |
409 | static void sun_set_alt_cyl(void); | 422 | STATIC_SUN void sun_set_alt_cyl(void); |
410 | static void sun_set_ncyl(int cyl); | 423 | STATIC_SUN void sun_set_ncyl(int cyl); |
411 | static void sun_set_xcyl(void); | 424 | STATIC_SUN void sun_set_xcyl(void); |
412 | static void sun_set_ilfact(void); | 425 | STATIC_SUN void sun_set_ilfact(void); |
413 | static void sun_set_rspeed(void); | 426 | STATIC_SUN void sun_set_rspeed(void); |
414 | static void sun_set_pcylcount(void); | 427 | STATIC_SUN void sun_set_pcylcount(void); |
415 | static void toggle_sunflags(int i, unsigned char mask); | 428 | STATIC_SUN void toggle_sunflags(int i, unsigned char mask); |
416 | static void verify_sun(void); | 429 | STATIC_SUN void verify_sun(void); |
417 | static void sun_write_table(void); | 430 | STATIC_SUN void sun_write_table(void); |
418 | #include "fdisk_sun.c" | 431 | #include "fdisk_sun.c" |
419 | 432 | ||
420 | /* DOS partition types */ | 433 | /* DOS partition types */ |
@@ -523,7 +536,6 @@ static const struct systypes i386_sys_types[] = { | |||
523 | }; | 536 | }; |
524 | 537 | ||
525 | 538 | ||
526 | |||
527 | /* A valid partition table sector ends in 0x55 0xaa */ | 539 | /* A valid partition table sector ends in 0x55 0xaa */ |
528 | static unsigned int | 540 | static unsigned int |
529 | part_table_flag(const char *b) | 541 | part_table_flag(const char *b) |
@@ -2921,7 +2933,7 @@ int fdisk_main(int argc, char **argv) | |||
2921 | /* OSF label, and no DOS label */ | 2933 | /* OSF label, and no DOS label */ |
2922 | printf(_("Detected an OSF/1 disklabel on %s, entering " | 2934 | printf(_("Detected an OSF/1 disklabel on %s, entering " |
2923 | "disklabel mode.\n"), disk_device); | 2935 | "disklabel mode.\n"), disk_device); |
2924 | bselect(); | 2936 | bsd_select(); |
2925 | /*Why do we do this? It seems to be counter-intuitive*/ | 2937 | /*Why do we do this? It seems to be counter-intuitive*/ |
2926 | current_label_type = label_dos; | 2938 | current_label_type = label_dos; |
2927 | /* If we return we may want to make an empty DOS label? */ | 2939 | /* If we return we may want to make an empty DOS label? */ |
@@ -2954,7 +2966,7 @@ int fdisk_main(int argc, char **argv) | |||
2954 | sgi_set_bootfile(line_ptr); | 2966 | sgi_set_bootfile(line_ptr); |
2955 | } else | 2967 | } else |
2956 | #ifdef CONFIG_FEATURE_OSF_LABEL | 2968 | #ifdef CONFIG_FEATURE_OSF_LABEL |
2957 | bselect(); | 2969 | bsd_select(); |
2958 | #endif | 2970 | #endif |
2959 | 2971 | ||
2960 | /* BUG!? Think what will happen if !CONFIG_FEATURE_OSF_LABEL !!! */ | 2972 | /* BUG!? Think what will happen if !CONFIG_FEATURE_OSF_LABEL !!! */ |
diff --git a/util-linux/fdisk_osf.c b/util-linux/fdisk_osf.c index 97fe79aca..17267d54b 100644 --- a/util-linux/fdisk_osf.c +++ b/util-linux/fdisk_osf.c | |||
@@ -345,7 +345,7 @@ is_bsd_partition_type(int type) | |||
345 | #endif | 345 | #endif |
346 | 346 | ||
347 | static void | 347 | static void |
348 | bselect(void) | 348 | bsd_select(void) |
349 | { | 349 | { |
350 | #if !defined (__alpha__) | 350 | #if !defined (__alpha__) |
351 | int t, ss; | 351 | int t, ss; |
diff --git a/util-linux/fdisk_sgi.c b/util-linux/fdisk_sgi.c index 98abcc086..8d6837f77 100644 --- a/util-linux/fdisk_sgi.c +++ b/util-linux/fdisk_sgi.c | |||
@@ -180,7 +180,7 @@ static const struct systypes sgi_sys_types[] = { | |||
180 | /* LINUX_NATIVE */ { "\x83" "Linux native" }, | 180 | /* LINUX_NATIVE */ { "\x83" "Linux native" }, |
181 | /* LINUX_LVM */ { "\x8d" "Linux LVM" }, | 181 | /* LINUX_LVM */ { "\x8d" "Linux LVM" }, |
182 | /* LINUX_RAID */ { "\xfd" "Linux RAID" }, | 182 | /* LINUX_RAID */ { "\xfd" "Linux RAID" }, |
183 | { NULL } | 183 | { NULL } |
184 | }; | 184 | }; |
185 | 185 | ||
186 | 186 | ||