From 6eaf0a98831960e3a4593e6630404634d747ab82 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Sun, 29 Jun 2008 05:10:47 +0000 Subject: 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 --- util-linux/fdisk_sun.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'util-linux/fdisk_sun.c') diff --git a/util-linux/fdisk_sun.c b/util-linux/fdisk_sun.c index eec319c6e..427efbee3 100644 --- a/util-linux/fdisk_sun.c +++ b/util-linux/fdisk_sun.c @@ -722,9 +722,6 @@ sun_write_table(void) while (ush < (unsigned short *)(&sunlabel->csum)) csum ^= *ush++; sunlabel->csum = csum; - if (lseek(dev_fd, 0, SEEK_SET) < 0) - fdisk_fatal(unable_to_seek); - if (write(dev_fd, sunlabel, SECTOR_SIZE) != SECTOR_SIZE) - fdisk_fatal(unable_to_write); + write_sector(0, sunlabel); } #endif /* SUN_LABEL */ -- cgit v1.2.3