diff options
-rw-r--r-- | util-linux/fdisk.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c index 7f046edfb..a1d31501b 100644 --- a/util-linux/fdisk.c +++ b/util-linux/fdisk.c | |||
@@ -86,8 +86,6 @@ struct partition { | |||
86 | static const char unable_to_open[] ALIGN1 = "cannot open %s"; | 86 | static const char unable_to_open[] ALIGN1 = "cannot open %s"; |
87 | static const char unable_to_read[] ALIGN1 = "cannot read from %s"; | 87 | static const char unable_to_read[] ALIGN1 = "cannot read from %s"; |
88 | static const char unable_to_seek[] ALIGN1 = "cannot seek on %s"; | 88 | static const char unable_to_seek[] ALIGN1 = "cannot seek on %s"; |
89 | static const char unable_to_write[] ALIGN1 = "cannot write to %s"; | ||
90 | static const char ioctl_error[] ALIGN1 = "BLKGETSIZE ioctl failed on %s"; | ||
91 | static void fdisk_fatal(const char *why) ATTRIBUTE_NORETURN; | 89 | static void fdisk_fatal(const char *why) ATTRIBUTE_NORETURN; |
92 | 90 | ||
93 | enum label_type { | 91 | enum label_type { |
@@ -320,7 +318,7 @@ struct globals { | |||
320 | struct pte ptes[MAXIMUM_PARTS]; | 318 | struct pte ptes[MAXIMUM_PARTS]; |
321 | }; | 319 | }; |
322 | #define G (*ptr_to_globals) | 320 | #define G (*ptr_to_globals) |
323 | #define line_ptr (G.line_ptr) | 321 | #define line_ptr (G.line_ptr ) |
324 | #define disk_device (G.disk_device ) | 322 | #define disk_device (G.disk_device ) |
325 | #define g_partitions (G.g_partitions ) | 323 | #define g_partitions (G.g_partitions ) |
326 | #define units_per_sector (G.units_per_sector ) | 324 | #define units_per_sector (G.units_per_sector ) |
@@ -346,11 +344,11 @@ struct globals { | |||
346 | #define kern_sectors (G.kern_sectors ) | 344 | #define kern_sectors (G.kern_sectors ) |
347 | #define extended_offset (G.extended_offset ) | 345 | #define extended_offset (G.extended_offset ) |
348 | #define total_number_of_sectors (G.total_number_of_sectors) | 346 | #define total_number_of_sectors (G.total_number_of_sectors) |
349 | #define listingbuf (G.listingbuf) | 347 | #define listingbuf (G.listingbuf ) |
350 | #define line_buffer (G.line_buffer) | 348 | #define line_buffer (G.line_buffer ) |
351 | #define partname_buffer (G.partname_buffer) | 349 | #define partname_buffer (G.partname_buffer) |
352 | #define MBRbuffer (G.MBRbuffer) | 350 | #define MBRbuffer (G.MBRbuffer ) |
353 | #define ptes (G.ptes) | 351 | #define ptes (G.ptes ) |
354 | #define INIT_G() do { \ | 352 | #define INIT_G() do { \ |
355 | SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \ | 353 | SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \ |
356 | sector_size = DEFAULT_SECTOR_SIZE; \ | 354 | sector_size = DEFAULT_SECTOR_SIZE; \ |
@@ -369,7 +367,7 @@ static ullong bb_BLKGETSIZE_sectors(int fd) | |||
369 | unsigned long longsectors; | 367 | unsigned long longsectors; |
370 | 368 | ||
371 | if (ioctl(fd, BLKGETSIZE64, &v64) == 0) { | 369 | if (ioctl(fd, BLKGETSIZE64, &v64) == 0) { |
372 | /* got bytes, convert to 512 byte sectors */ | 370 | /* Got bytes, convert to 512 byte sectors */ |
373 | return (v64 >> 9); | 371 | return (v64 >> 9); |
374 | } | 372 | } |
375 | /* Needs temp of type long */ | 373 | /* Needs temp of type long */ |
@@ -414,7 +412,7 @@ close_dev_fd(void) | |||
414 | } | 412 | } |
415 | 413 | ||
416 | #if ENABLE_FEATURE_FDISK_WRITABLE | 414 | #if ENABLE_FEATURE_FDISK_WRITABLE |
417 | /* read line; return 0 or first printable char */ | 415 | /* Read line; return 0 or first printable char */ |
418 | static int | 416 | static int |
419 | read_line(const char *prompt) | 417 | read_line(const char *prompt) |
420 | { | 418 | { |
@@ -435,7 +433,7 @@ read_line(const char *prompt) | |||
435 | #endif | 433 | #endif |
436 | 434 | ||
437 | /* | 435 | /* |
438 | * return partition name - uses static storage | 436 | * Return partition name - uses static storage |
439 | */ | 437 | */ |
440 | static const char * | 438 | static const char * |
441 | partname(const char *dev, int pno, int lth) | 439 | partname(const char *dev, int pno, int lth) |