sulogin

Denis Vlasenko vda.linux at googlemail.com
Fri Oct 20 22:22:32 UTC 2006


On Friday 20 October 2006 22:20, Tito wrote:
> Hi Denis,
> I've a little size optimization for sulogin that I'm sure will win your obfuscated code price ;-)
> 
> function                                             old     new   delta
> sulogin_main                                   489     488      -1
> ------------------------------------------------------------------------------
> (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-1)               Total: -1 bytes

Sorry Tito, but size gain is far too small
and also may be gcc version dependent... IOW: good compiler
should save that byte without obfuscated C.

There are a lot of more useful/needed things to do:

Doesn't mount anything: mount -n -a -t nonfs,smbfs,ncpfs
Doesn't work: watch -d 'w=90; h=34; tail -$((h-3)) current 2>&1 | tai64nlocal | cut -b0-$((w-2))'
Doesn't work: tar cvf - -T - --no-recursion
Doesn't work: cp -s
New kbuild uses this for make clean, but our find
doesn't handle:
find . ( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS -o -name .pc -o -name .hg -o -name .git ) -prune ...

etc...
You are not obliged to do anything of it, don't misunderstand me,
it's all voluntary. But chasing 1 byte of text while there are
far bigger fruits hanging... not very productive.

> -       shell = getenv("SUSHELL");
> -       if (!shell) shell = getenv("sushell");
> -       if (!shell) {
> -               shell = "/bin/sh";
> -               if (pwd->pw_shell[0])
> -                       shell = pwd->pw_shell;
> -       }
> -       run_shell(shell, 1, 0, 0);
> +       run_shell(getenv("SUSHELL") ? : getenv("sushell") ? : pwd->pw_shell ? : DEFAULT_SHELL, 1, 0, 0);
>         /* never returns */
> 
>  auth_error:
--
vda



More information about the busybox mailing list