[BusyBox] [PATCH] size optimisation for fdformat.c

Vladimir N. Oleynik dzo at simtreas.ru
Wed Jan 21 14:51:08 UTC 2004


Tito,

> global_var = DIE|ERROR|WHATEVER;
> fd = xfopen(.......);
> global_var= DIE|PERROR;
> xreadlink(....);
> and so on.
> 
> Wouldn't this waste more space than:
> 
> fd = xfopen(path, mode, DIE|ERROR);
> 
> Or am I totally wrong................. §8-]

My old idea:

global_error_mask for

| STDERR_TO_SYSLOG (may be one call from each applet)
| CONTINE_NO_EXIT (only for bb_strdup, xmalloc), set each require place and 
unset after call libbb function.
| STDERR_TO_STDOUT - specail case for messages: "applet_name: message", set each 
require place and unset after
call libbb function.

other function: xfopen, wfopen, error_msg and error_msg_and_die unchanged and 
use as current.

Also, current libbb API syslog_msg_with_name() is very uncomfortable.
I think, "| STDERR_TO_SYSLOG" must other bytes:
- OPEN_SYSYLOG_FIRST
- CLOSE_SYSLOG_AFTER
- ALL facility and priority convert to **2 sequentaly to this global var mask.
result: syslog msg can have "printf" syntax, one call openlog() from libbb for 
the whole bb projects



--w
vodz




More information about the busybox mailing list