aboutsummaryrefslogtreecommitdiff
path: root/util-linux/fdisk_sgi.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-06-29 05:10:47 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-06-29 05:10:47 +0000
commit6eaf0a98831960e3a4593e6630404634d747ab82 (patch)
tree433a90cad26f3c6ae9eff8572be94773523789e4 /util-linux/fdisk_sgi.c
parentce13b7600277478055de0b7c38b483a76145efd2 (diff)
downloadbusybox-w32-6eaf0a98831960e3a4593e6630404634d747ab82.tar.gz
busybox-w32-6eaf0a98831960e3a4593e6630404634d747ab82.tar.bz2
busybox-w32-6eaf0a98831960e3a4593e6630404634d747ab82.zip
fdisk: move more data to struct globals; shrink code
function old new delta nowarn 1 - -1 listing 1 - -1 dos_compatible_flag 1 - -1 warn_cylinders 44 42 -2 open_list_and_close 364 362 -2 fdisk_fatal 41 38 -3 verify 1053 1049 -4 user_sectors 4 - -4 user_heads 4 - -4 user_cylinders 4 - -4 pt_sectors 4 - -4 pt_heads 4 - -4 kern_sectors 4 - -4 kern_heads 4 - -4 ext_index 4 - -4 total_number_of_sectors 8 - -8 extended_offset 8 - -8 create_doslabel 129 120 -9 write_table 225 211 -14 delete_partition 445 431 -14 set_partition 476 459 -17 list_disk_geometry 247 229 -18 unable_to_write 19 - -19 add_partition 2515 2486 -29 get_boot 1709 1636 -73 fdisk_main 2812 2679 -133 ------------------------------------------------------------------------------ (add/remove: 0/14 grow/shrink: 0/12 up/down: 0/-388) Total: -388 bytes text data bss dec hex filename 804634 611 6852 812097 c6441 busybox_old 804298 610 6804 811712 c62c0 busybox_unstripped
Diffstat (limited to 'util-linux/fdisk_sgi.c')
-rw-r--r--util-linux/fdisk_sgi.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/util-linux/fdisk_sgi.c b/util-linux/fdisk_sgi.c
index 55e77d58c..5a86a6848 100644
--- a/util-linux/fdisk_sgi.c
+++ b/util-linux/fdisk_sgi.c
@@ -439,10 +439,7 @@ sgi_write_table(void)
439 assert(two_s_complement_32bit_sum( 439 assert(two_s_complement_32bit_sum(
440 (unsigned int*)sgilabel, sizeof(*sgilabel)) == 0); 440 (unsigned int*)sgilabel, sizeof(*sgilabel)) == 0);
441 441
442 if (lseek(dev_fd, 0, SEEK_SET) < 0) 442 write_sector(0, sgilabel);
443 fdisk_fatal(unable_to_seek);
444 if (write(dev_fd, sgilabel, SECTOR_SIZE) != SECTOR_SIZE)
445 fdisk_fatal(unable_to_write);
446 if (!strncmp((char*)sgilabel->directory[0].vol_file_name, "sgilabel", 8)) { 443 if (!strncmp((char*)sgilabel->directory[0].vol_file_name, "sgilabel", 8)) {
447 /* 444 /*
448 * keep this habit of first writing the "sgilabel". 445 * keep this habit of first writing the "sgilabel".
@@ -450,10 +447,7 @@ sgi_write_table(void)
450 */ 447 */
451 sgiinfo *info = fill_sgiinfo(); 448 sgiinfo *info = fill_sgiinfo();
452 int infostartblock = SGI_SSWAP32(sgilabel->directory[0].vol_file_start); 449 int infostartblock = SGI_SSWAP32(sgilabel->directory[0].vol_file_start);
453 if (lseek(dev_fd, infostartblock*SECTOR_SIZE, SEEK_SET) < 0) 450 write_sector(infostartblock, info);
454 fdisk_fatal(unable_to_seek);
455 if (write(dev_fd, info, SECTOR_SIZE) != SECTOR_SIZE)
456 fdisk_fatal(unable_to_write);
457 free(info); 451 free(info);
458 } 452 }
459} 453}