[PATCH] size reduction in update_passwd.c

Tito farmatito at tiscali.it
Thu Apr 23 19:55:48 UTC 2009


Hi,
this patch reduces size of update_passwd.c when FEATURE_SHADOWPASSWDS
is not set. Bloat-o-meter is:

debian:~/Desktop/busybox$ scripts/bloat-o-meter busybox_old busybox_unstripped
function                                             old     new   delta
.rodata                                           125464  125457      -7
update_passwd                                       1159    1116     -43
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-50)             Total: -50 bytes

--- libbb/update_passwd.c.orig  2009-04-14 14:13:42.000000000 +0200
+++ libbb/update_passwd.c       2009-04-23 21:49:00.000000000 +0200
@@ -100,7 +100,7 @@
        name = xasprintf("%s:", name);
        user_len = strlen(name);

-       if (strstr(filename, "shadow"))
+       if (ENABLE_FEATURE_SHADOWPASSWDS && strstr(filename, "shadow"))
                old_fp = fopen(filename, "r+");
        else
                old_fp = fopen_or_warn(filename, "r+");


Ciao,
Tito
-------------- next part --------------
A non-text attachment was scrubbed...
Name: update_passwd.patch
Type: text/x-diff
Size: 396 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20090423/abb61396/attachment.bin>


More information about the busybox mailing list