cap-list: rename capability_set_to_string_alloc() → capability_set_to_string()
We typically don't use the _alloc() suffix anymore for anything, hence drop it here too.
This commit is contained in:
@@ -56,11 +56,11 @@ int capability_list_length(void) {
|
||||
return (int) ELEMENTSOF(capability_names);
|
||||
}
|
||||
|
||||
int capability_set_to_string_alloc(uint64_t set, char **s) {
|
||||
int capability_set_to_string(uint64_t set, char **ret) {
|
||||
_cleanup_free_ char *str = NULL;
|
||||
size_t n = 0;
|
||||
|
||||
assert(s);
|
||||
assert(ret);
|
||||
|
||||
for (unsigned i = 0; i <= cap_last_cap(); i++)
|
||||
if (set & (UINT64_C(1) << i)) {
|
||||
@@ -88,8 +88,7 @@ int capability_set_to_string_alloc(uint64_t set, char **s) {
|
||||
|
||||
str[n > 0 ? n - 1 : 0] = '\0'; /* truncate the last space, if it's there */
|
||||
|
||||
*s = TAKE_PTR(str);
|
||||
|
||||
*ret = TAKE_PTR(str);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,5 +7,5 @@ const char *capability_to_name(int id);
|
||||
int capability_from_name(const char *name);
|
||||
int capability_list_length(void);
|
||||
|
||||
int capability_set_to_string_alloc(uint64_t set, char **s);
|
||||
int capability_set_to_string(uint64_t set, char **ret);
|
||||
int capability_set_from_string(const char *s, uint64_t *set);
|
||||
|
||||
Reference in New Issue
Block a user