Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/libbb/parse_mode.c
- Timestamp:
- Dec 20, 2016, 4:07:32 PM (7 years ago)
- Location:
- branches/3.3
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mindi-busybox/libbb/parse_mode.c
r2725 r3621 16 16 #define FILEMODEBITS (S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO) 17 17 18 int FAST_FUNC bb_parse_mode(const char *s, mode_t *current_mode)18 int FAST_FUNC bb_parse_mode(const char *s, unsigned current_mode) 19 19 { 20 20 static const mode_t who_mask[] = { … … 47 47 tmp = strtoul(s, &e, 8); 48 48 if (*e || (tmp > 07777U)) { /* Check range and trailing chars. */ 49 return 0;49 return -1; 50 50 } 51 *current_mode = tmp; 52 return 1; 51 return tmp; 53 52 } 54 53 55 new_mode = *current_mode;54 new_mode = current_mode; 56 55 57 56 /* Note: we allow empty clauses, and hence empty modes. … … 72 71 wholist |= who_mask[(int)(p-who_chars)]; 73 72 if (!*++s) { 74 return 0;73 return -1; 75 74 } 76 75 goto WHO_LIST; … … 81 80 if ((*s != '+') && (*s != '-')) { 82 81 if (*s != '=') { 83 return 0;82 return -1; 84 83 } 85 84 /* Since op is '=', clear all bits corresponding to the … … 146 145 } 147 146 148 *current_mode = new_mode; 149 return 1; 147 return new_mode; 150 148 }
Note:
See TracChangeset
for help on using the changeset viewer.