From d0a071a5281f8ba4b291f0c3beb74bee1f8df6a3 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Mon, 17 Mar 2008 09:33:45 +0000 Subject: brctl: eliminate stray data object brctl: use constant fd to reduce parameter passing runsvdir: do not use data/bss od: reuse bb_argv_dash last: do not go into endless loop on read error mount: make it not fail scripts/find_bad_common_bufsiz check dc: add INIT_G() (no-op for dc, but we want uniform usage of "G trick") function old new delta runsvdir_main 1646 1672 +26 set_pgrp 1 - -1 exitsoon 1 - -1 check 679 678 -1 svnum 4 - -4 svdir 4 - -4 sv 4 - -4 stamplog 4 - -4 rploglen 4 - -4 rplog 4 - -4 mount_main 995 988 -7 static.default_file_list 8 - -8 pfd 8 - -8 logpipe 8 - -8 static.info 20 - -20 brctl_main 767 739 -28 ------------------------------------------------------------------------------ (add/remove: 0/12 grow/shrink: 1/3 up/down: 26/-106) Total: -80 bytes text data bss dec hex filename 793327 662 7412 801401 c3a79 busybox_old 793329 641 7372 801342 c3a3e busybox_unstripped --- util-linux/mount.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'util-linux/mount.c') diff --git a/util-linux/mount.c b/util-linux/mount.c index a0e6cda73..d4a320756 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c @@ -214,9 +214,10 @@ struct globals { unsigned verbose; #endif llist_t *fslist; - char getmntent_buf[sizeof(bb_common_bufsiz1) - 8*3]; + char getmntent_buf[1]; }; +enum { GETMNTENT_BUFSIZE = COMMON_BUFSIZE - offsetof(struct globals, getmntent_buf) }; #define G (*(struct globals*)&bb_common_bufsiz1) #define nfs_mount_version (G.nfs_mount_version) #if ENABLE_FEATURE_MOUNT_VERBOSE @@ -1775,7 +1776,7 @@ int mount_main(int argc, char **argv) if (!mountTable) bb_error_msg_and_die("no %s", bb_path_mtab_file); while (getmntent_r(mountTable, &mtpair[0], getmntent_buf, - sizeof(getmntent_buf))) + GETMNTENT_BUFSIZE)) { // Don't show rootfs. FIXME: why?? // util-linux 2.12a happily shows rootfs... @@ -1842,8 +1843,8 @@ int mount_main(int argc, char **argv) // Get next fstab entry if (!getmntent_r(fstab, mtcur, getmntent_buf - + (mtcur==mtpair ? sizeof(getmntent_buf)/2 : 0), - sizeof(getmntent_buf)/2)) + + (mtcur==mtpair ? GETMNTENT_BUFSIZE/2 : 0), + GETMNTENT_BUFSIZE/2)) { // Were we looking for something specific? -- cgit v1.2.3