bb_simple_perror_msg_and_die("capget");
}
-static void parse_cap(unsigned long *index, const char *cap)
+static unsigned long parse_cap(const char *cap)
{
unsigned long i;
if ((sscanf(cap, "cap_%lu", &i)) == 1) {
if (!cap_valid(i))
bb_error_msg_and_die("unsupported capability '%s'", cap);
- *index = i;
- return;
+ return i;
}
# if ENABLE_FEATURE_SETPRIV_CAPABILITY_NAMES
if (!cap_valid(i))
bb_error_msg_and_die("unsupported capability '%s'", cap);
- *index = i;
- return;
+ return i;
}
# endif
while (capstring) {
unsigned long cap;
- parse_cap(&cap, capstring);
+ cap = parse_cap(capstring);
if (CAP_TO_INDEX(cap) >= caps.u32s)
bb_error_msg_and_die("invalid capability cap");
while (cap) {
unsigned long index;
- parse_cap(&index, cap);
+ index = parse_cap(cap);
if (cap[0] == '+') {
if (prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_RAISE, index, 0, 0) < 0)
bb_perror_msg("cap_ambient_raise");
int opts;
IF_FEATURE_SETPRIV_CAPABILITIES(char *inh_caps, *ambient_caps;)
- opts = getopt32long(argv,
- "+"IF_FEATURE_SETPRIV_DUMP("d")
+ opts = getopt32long(argv, "+"
+ IF_FEATURE_SETPRIV_DUMP("d")
IF_FEATURE_SETPRIV_CAPABILITIES("\xfe:\xfd:"),
setpriv_longopts
IF_FEATURE_SETPRIV_CAPABILITIES(, &inh_caps, &ambient_caps)