libbb: more compact API for bb_parse_mode()
function old new delta make_device 2182 2188 +6 parse_command 1440 1443 +3 parse_params 1497 1499 +2 install_main 773 769 -4 mkdir_main 168 160 -8 getoptscmd 641 632 -9 builtin_umask 158 147 -11 bb_parse_mode 431 410 -21 umaskcmd 286 258 -28 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/6 up/down: 11/-81) Total: -70 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
@@ -12862,7 +12862,8 @@ umaskcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
|
||||
/* symbolic umasks are inverted: "umask a=rx" calls umask(222) */
|
||||
if (!isdigit(modestr[0]))
|
||||
mask ^= 0777;
|
||||
if (!bb_parse_mode(modestr, &mask) || (unsigned)mask > 0777) {
|
||||
mask = bb_parse_mode(modestr, mask);
|
||||
if ((unsigned)mask > 0777) {
|
||||
ash_msg_and_raise_error("illegal mode: %s", modestr);
|
||||
}
|
||||
if (!isdigit(modestr[0]))
|
||||
|
||||
Reference in New Issue
Block a user