#include "libbb.h"
+/* This function is used from NOFORK applets. It must not allocate anything */
+
#define FILEMODEBITS (S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO)
-int bb_parse_mode(const char *s, mode_t *current_mode)
+int FAST_FUNC bb_parse_mode(const char *s, mode_t *current_mode)
{
static const mode_t who_mask[] = {
S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO, /* a */
S_ISUID | S_ISGID, /* s */
S_ISVTX /* t */
};
- static const char who_chars[] = "augo";
- static const char perm_chars[] = "rwxXst";
+ static const char who_chars[] ALIGN1 = "augo";
+ static const char perm_chars[] ALIGN1 = "rwxXst";
const char *p;
mode_t wholist;
mode_t new_mode;
char op;
- if (((unsigned int)(*s - '0')) < 8) {
+ if ((unsigned char)(*s - '0') < 8) {
unsigned long tmp;
char *e;