libbb: code shrink bb_parse_mode
function old new delta bb_parse_mode 393 398 +5 static.who_mask 16 8 -8 static.perm_mask 24 12 -12 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 5/-20) Total: -15 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
2df4e0a370
commit
4958c18134
2 changed files with 4 additions and 3 deletions
|
@ -16,13 +16,14 @@
|
|||
|
||||
int FAST_FUNC bb_parse_mode(const char *s, unsigned current_mode)
|
||||
{
|
||||
static const mode_t who_mask[] = {
|
||||
/* should be mode_t really, but in all Unixes these constants fit into uint16 */
|
||||
static const uint16_t who_mask[] ALIGN2 = {
|
||||
S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO, /* a */
|
||||
S_ISUID | S_IRWXU, /* u */
|
||||
S_ISGID | S_IRWXG, /* g */
|
||||
S_IRWXO /* o */
|
||||
};
|
||||
static const mode_t perm_mask[] = {
|
||||
static const uint16_t perm_mask[] ALIGN2 = {
|
||||
S_IRUSR | S_IRGRP | S_IROTH, /* r */
|
||||
S_IWUSR | S_IWGRP | S_IWOTH, /* w */
|
||||
S_IXUSR | S_IXGRP | S_IXOTH, /* x */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue