Instead of _cleanup_(set_freep) or so.
void *userdata) {
SecurityInfo *info = userdata;
- _cleanup_(strv_freep) char **l = NULL;
+ _cleanup_strv_free_ char **l = NULL;
int r;
assert(bus);
_cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
Manager *m = ASSERT_PTR(userdata);
UnitFileList *item;
- _cleanup_(hashmap_freep) Hashmap *h = NULL;
+ _cleanup_hashmap_free_ Hashmap *h = NULL;
int r;
assert(message);
}
for (;;) {
- _cleanup_(hashmap_freep) Hashmap *other_deps = NULL;
+ _cleanup_hashmap_free_ Hashmap *other_deps = NULL;
UnitDependencyInfo di_back;
Unit *back;
}
static int add_credentials_to_table(Table *t, bool encrypted) {
- _cleanup_(closedirp) DIR *d = NULL;
+ _cleanup_closedir_ DIR *d = NULL;
const char *prefix;
int r;
/* Look both in regular and in encrypted credentials */
for (encrypted = 0; encrypted < 2; encrypted++) {
- _cleanup_(closedirp) DIR *d = NULL;
+ _cleanup_closedir_ DIR *d = NULL;
r = open_credential_directory(encrypted, &d, NULL);
if (r < 0)
Set *keep_slots,
unsigned by_mask) {
- _cleanup_(set_freep) Set *listed_slots = NULL;
+ _cleanup_set_free_ Set *listed_slots = NULL;
int r;
assert(cd);
unsigned by_mask,
int except_slot) {
- _cleanup_(set_freep) Set *wipe_slots = NULL, *wipe_tokens = NULL, *keep_slots = NULL;
+ _cleanup_set_free_ Set *wipe_slots = NULL, *wipe_tokens = NULL, *keep_slots = NULL;
_cleanup_free_ int *ordered_slots = NULL, *ordered_tokens = NULL;
size_t n_ordered_slots = 0, n_ordered_tokens = 0;
int r, slot_max, ret;
}
static int action_discover(void) {
- _cleanup_(hashmap_freep) Hashmap *images = NULL;
+ _cleanup_hashmap_free_ Hashmap *images = NULL;
_cleanup_(table_unrefp) Table *t = NULL;
Image *img;
int r;
int identity_add_token_pin(JsonVariant **v, const char *pin) {
_cleanup_(json_variant_unrefp) JsonVariant *w = NULL, *l = NULL;
- _cleanup_(strv_free_erasep) char **pins = NULL;
+ _cleanup_strv_free_erase_ char **pins = NULL;
int r;
assert(v);
static int add_secret(JsonVariant **v, const char *password) {
_cleanup_(json_variant_unrefp) JsonVariant *w = NULL, *l = NULL;
- _cleanup_(strv_free_erasep) char **passwords = NULL;
+ _cleanup_strv_free_erase_ char **passwords = NULL;
int r;
assert(v);
bool emphasize_current,
AskPasswordFlags flags) {
- _cleanup_(strv_free_erasep) char **password = NULL;
+ _cleanup_strv_free_erase_ char **password = NULL;
_cleanup_(erase_and_freep) char *envpw = NULL;
_cleanup_free_ char *question = NULL;
int r;
UserRecord *hr,
AskPasswordFlags flags) {
- _cleanup_(strv_free_erasep) char **recovery_key = NULL;
+ _cleanup_strv_free_erase_ char **recovery_key = NULL;
_cleanup_(erase_and_freep) char *envpw = NULL;
_cleanup_free_ char *question = NULL;
int r;
UserRecord *hr,
AskPasswordFlags flags) {
- _cleanup_(strv_free_erasep) char **pin = NULL;
+ _cleanup_strv_free_erase_ char **pin = NULL;
_cleanup_(erase_and_freep) char *envpin = NULL;
_cleanup_free_ char *question = NULL;
int r;
static int inspect_home(int argc, char *argv[], void *userdata) {
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
- _cleanup_(strv_freep) char **mangled_list = NULL;
+ _cleanup_strv_free_ char **mangled_list = NULL;
int r, ret = 0;
char **items;
static int authenticate_home(int argc, char *argv[], void *userdata) {
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
- _cleanup_(strv_freep) char **mangled_list = NULL;
+ _cleanup_strv_free_ char **mangled_list = NULL;
int r, ret = 0;
char **items;
(void) suggest_passwords();
for (;;) {
- _cleanup_(strv_free_erasep) char **first = NULL, **second = NULL;
+ _cleanup_strv_free_erase_ char **first = NULL, **second = NULL;
_cleanup_free_ char *question = NULL;
if (--i == 0)
case ARG_SSH_AUTHORIZED_KEYS: {
_cleanup_(json_variant_unrefp) JsonVariant *v = NULL;
- _cleanup_(strv_freep) char **l = NULL, **add = NULL;
+ _cleanup_strv_free_ char **l = NULL, **add = NULL;
if (isempty(optarg)) {
r = drop_from_identity("sshAuthorizedKeys");
return r;
HASHMAP_FOREACH(h, m->homes_by_name) {
- _cleanup_(strv_freep) char **seats = NULL;
+ _cleanup_strv_free_ char **seats = NULL;
_cleanup_free_ char *home_path = NULL;
r = home_auto_login(h, &seats);
}
static int manager_load_key_pair(Manager *m) {
- _cleanup_(fclosep) FILE *f = NULL;
+ _cleanup_fclose_ FILE *f = NULL;
struct stat st;
int r;
STRV_FOREACH(pw, h->password) {
_cleanup_(unlink_and_freep) char *p = NULL;
_cleanup_free_ char *options = NULL;
- _cleanup_(fclosep) FILE *f = NULL;
+ _cleanup_fclose_ FILE *f = NULL;
pid_t mount_pid;
int exit_status;
}
static int read_identity_file(int root_fd, JsonVariant **ret) {
- _cleanup_(fclosep) FILE *identity_file = NULL;
+ _cleanup_fclose_ FILE *identity_file = NULL;
_cleanup_close_ int identity_fd = -EBADF;
unsigned line, column;
int r;
static int write_identity_file(int root_fd, JsonVariant *v, uid_t uid) {
_cleanup_(json_variant_unrefp) JsonVariant *normalized = NULL;
- _cleanup_(fclosep) FILE *identity_file = NULL;
+ _cleanup_fclose_ FILE *identity_file = NULL;
_cleanup_close_ int identity_fd = -EBADF;
_cleanup_free_ char *fn = NULL;
int r;
PasswordCache *cache,
char ***ret_effective_passwords) {
- _cleanup_(strv_free_erasep) char **effective = NULL;
+ _cleanup_strv_free_erase_ char **effective = NULL;
size_t n;
int r;
}
static int home_create(UserRecord *h, UserRecord **ret_home) {
- _cleanup_(strv_free_erasep) char **effective_passwords = NULL;
+ _cleanup_strv_free_erase_ char **effective_passwords = NULL;
_cleanup_(home_setup_done) HomeSetup setup = HOME_SETUP_INIT;
_cleanup_(user_record_unrefp) UserRecord *new_home = NULL;
_cleanup_(password_cache_free) PasswordCache cache = {};
static int home_passwd(UserRecord *h, UserRecord **ret_home) {
_cleanup_(user_record_unrefp) UserRecord *header_home = NULL, *embedded_home = NULL, *new_home = NULL;
- _cleanup_(strv_free_erasep) char **effective_passwords = NULL;
+ _cleanup_strv_free_erase_ char **effective_passwords = NULL;
_cleanup_(home_setup_done) HomeSetup setup = HOME_SETUP_INIT;
_cleanup_(password_cache_free) PasswordCache cache = {};
HomeSetupFlags flags = 0;
static int run(int argc, char *argv[]) {
_cleanup_(user_record_unrefp) UserRecord *home = NULL, *new_home = NULL;
_cleanup_(json_variant_unrefp) JsonVariant *v = NULL;
- _cleanup_(fclosep) FILE *opened_file = NULL;
+ _cleanup_fclose_ FILE *opened_file = NULL;
unsigned line = 0, column = 0;
const char *json_path = NULL;
FILE *json_file;
int user_record_set_password(UserRecord *h, char **password, bool prepend) {
_cleanup_(json_variant_unrefp) JsonVariant *w = NULL;
- _cleanup_(strv_free_erasep) char **e = NULL;
+ _cleanup_strv_free_erase_ char **e = NULL;
int r;
assert(h);
int user_record_set_token_pin(UserRecord *h, char **pin, bool prepend) {
_cleanup_(json_variant_unrefp) JsonVariant *w = NULL;
- _cleanup_(strv_free_erasep) char **e = NULL;
+ _cleanup_strv_free_erase_ char **e = NULL;
int r;
assert(h);
static bool test_sd_device_enumerator_filter_subsystem_trial(void) {
_cleanup_(sd_device_enumerator_unrefp) sd_device_enumerator *e = NULL;
- _cleanup_(hashmap_freep) Hashmap *subsystems = NULL;
+ _cleanup_hashmap_free_ Hashmap *subsystems = NULL;
unsigned n_new_dev = 0, n_removed_dev = 0;
sd_device *d;
Hashmap *h;
bool expect_ratelimit = false, manually_left_ratelimit = false;
_cleanup_(sd_event_source_unrefp) sd_event_source *s = NULL;
_cleanup_(sd_event_unrefp) sd_event *e = NULL;
- _cleanup_(close_pairp) int pfd[2] = PIPE_EBADF;
+ _cleanup_close_pair_ int pfd[2] = PIPE_EBADF;
unsigned c = 0;
int r;
{}
};
- _cleanup_(fdset_freep) FDSet *passed = NULL;
+ _cleanup_fdset_free_ FDSet *passed = NULL;
bool do_exec = false;
int c, r, n_env;
const char *try1 = NULL, *try2 = NULL;
char p[SYS_BLOCK_PATH_MAX("/slaves")];
- _cleanup_(closedirp) DIR *d = NULL;
+ _cleanup_closedir_ DIR *d = NULL;
sd_id128_t found_uuid = SD_ID128_NULL;
dev_t devno, found = 0;
int r;
else {
_cleanup_(dissected_image_unrefp) DissectedImage *m = NULL;
_cleanup_(rmdir_and_freep) char *tmpdir = NULL;
- _cleanup_(close_pairp) int seq[2] = PIPE_EBADF;
+ _cleanup_close_pair_ int seq[2] = PIPE_EBADF;
_cleanup_(sigkill_waitp) pid_t child = 0;
/* We now have a loopback block device, let's fork off a child in its own mount namespace, mount it
_cleanup_(portable_metadata_unrefp) PortableMetadata *os_release = NULL;
_cleanup_ordered_hashmap_free_ OrderedHashmap *extension_images = NULL, *extension_releases = NULL;
_cleanup_hashmap_free_ Hashmap *unit_files = NULL;
- _cleanup_(strv_freep) char **valid_prefixes = NULL;
+ _cleanup_strv_free_ char **valid_prefixes = NULL;
_cleanup_(image_unrefp) Image *image = NULL;
int r;
}
static int list_files(PStoreList *list, const char *sourcepath) {
- _cleanup_(closedirp) DIR *dirp = NULL;
+ _cleanup_closedir_ DIR *dirp = NULL;
int r;
dirp = opendir(sourcepath);
const char *root,
const char *dir) {
- _cleanup_(closedirp) DIR *d = NULL;
+ _cleanup_closedir_ DIR *d = NULL;
_cleanup_free_ char *full = NULL;
int r;
/* Hmm, pity, this didn't fit. Let's fall back to /tmp then, see below */
} else {
- _cleanup_(close_pairp) int pipefds[2] = PIPE_EBADF;
+ _cleanup_close_pair_ int pipefds[2] = PIPE_EBADF;
int isz;
/* If memfds aren't available, use a pipe. Set O_NONBLOCK so that we will get EAGAIN rather
};
_cleanup_(json_variant_unrefp) JsonVariant *package_metadata = NULL;
- _cleanup_(set_freep) Set *modules = NULL;
+ _cleanup_set_free_ Set *modules = NULL;
_cleanup_free_ char *buf = NULL; /* buf should be freed last, c.f closed first (via stack_context_destroy) */
_cleanup_(stack_context_destroy) StackContext c = {
.package_metadata = &package_metadata,
static int parse_elf(int fd, const char *executable, char **ret, JsonVariant **ret_package_metadata) {
_cleanup_(json_variant_unrefp) JsonVariant *package_metadata = NULL, *elf_metadata = NULL;
- _cleanup_(set_freep) Set *modules = NULL;
+ _cleanup_set_free_ Set *modules = NULL;
_cleanup_free_ char *buf = NULL; /* buf should be freed last, c.f closed first (via stack_context_destroy) */
_cleanup_(stack_context_destroy) StackContext c = {
.package_metadata = &package_metadata,
}
int get_keymaps(char ***ret) {
- _cleanup_(set_free_freep) Set *keymaps = NULL;
+ _cleanup_set_free_free_ Set *keymaps = NULL;
int r;
keymaps = set_new(&string_hash_ops);
"Token asks for PIN but doesn't advertise 'clientPin' feature.");
for (;;) {
- _cleanup_(strv_free_erasep) char **pin = NULL;
+ _cleanup_strv_free_erase_ char **pin = NULL;
r = ask_password_auto("Please enter security token PIN:", askpw_icon_name, NULL, "fido2-pin", "fido2-pin", USEC_INFINITY, 0, &pin);
if (r < 0)
}
int mkfs_options_from_env(const char *component, const char *fstype, char ***ret) {
- _cleanup_(strv_freep) char **l = NULL;
+ _cleanup_strv_free_ char **l = NULL;
const char *e;
char *n;
/* Store current capacity of each battery before suspension and timestamp */
int fetch_batteries_capacity_by_name(Hashmap **ret) {
_cleanup_(sd_device_enumerator_unrefp) sd_device_enumerator *e = NULL;
- _cleanup_(hashmap_freep) Hashmap *batteries_capacity_by_name = NULL;
+ _cleanup_hashmap_free_ Hashmap *batteries_capacity_by_name = NULL;
sd_device *dev;
int r;
int tpm2_list_devices(void) {
#if HAVE_TPM2
_cleanup_(table_unrefp) Table *t = NULL;
- _cleanup_(closedirp) DIR *d = NULL;
+ _cleanup_closedir_ DIR *d = NULL;
int r;
r = dlopen_tpm2();
int log_level, /* log level when no device is found */
char **ret) {
#if HAVE_TPM2
- _cleanup_(closedirp) DIR *d = NULL;
+ _cleanup_closedir_ DIR *d = NULL;
int r;
r = dlopen_tpm2();
JsonVariant *query,
UserDBFlags flags) {
- _cleanup_(strv_freep) char **except = NULL, **only = NULL;
- _cleanup_(closedirp) DIR *d = NULL;
+ _cleanup_strv_free_ char **except = NULL, **only = NULL;
+ _cleanup_closedir_ DIR *d = NULL;
const char *e;
int r, ret = 0;
}
static int remount_with_timeout(MountPoint *m, bool last_try) {
- _cleanup_(close_pairp) int pfd[2] = PIPE_EBADF;
+ _cleanup_close_pair_ int pfd[2] = PIPE_EBADF;
_cleanup_(sigkill_nowaitp) pid_t pid = 0;
int r;
}
static int umount_with_timeout(MountPoint *m, bool last_try) {
- _cleanup_(close_pairp) int pfd[2] = PIPE_EBADF;
+ _cleanup_close_pair_ int pfd[2] = PIPE_EBADF;
_cleanup_(sigkill_nowaitp) pid_t pid = 0;
int r;
}
static int run(int argc, char *argv[]) {
- _cleanup_(ordered_hashmap_freep) OrderedHashmap *sysctl_options = NULL;
+ _cleanup_ordered_hashmap_free_ OrderedHashmap *sysctl_options = NULL;
int r, k;
r = parse_argv(argc, argv);
}
static int image_discover_and_read_metadata(Hashmap **ret_images) {
- _cleanup_(hashmap_freep) Hashmap *images = NULL;
+ _cleanup_hashmap_free_ Hashmap *images = NULL;
Image *img;
int r;
}
static int verb_merge(int argc, char **argv, void *userdata) {
- _cleanup_(hashmap_freep) Hashmap *images = NULL;
+ _cleanup_hashmap_free_ Hashmap *images = NULL;
int r;
r = have_effective_cap(CAP_SYS_ADMIN);
}
static int verb_refresh(int argc, char **argv, void *userdata) {
- _cleanup_(hashmap_freep) Hashmap *images = NULL;
+ _cleanup_hashmap_free_ Hashmap *images = NULL;
int r;
r = have_effective_cap(CAP_SYS_ADMIN);
}
static int verb_list(int argc, char **argv, void *userdata) {
- _cleanup_(hashmap_freep) Hashmap *images = NULL;
+ _cleanup_hashmap_free_ Hashmap *images = NULL;
_cleanup_(table_unrefp) Table *t = NULL;
Image *img;
int r;
#include "terminal-util.h"
int verb_cat(int argc, char *argv[], void *userdata) {
- _cleanup_(hashmap_freep) Hashmap *cached_name_map = NULL, *cached_id_map = NULL;
+ _cleanup_hashmap_free_ Hashmap *cached_name_map = NULL, *cached_id_map = NULL;
_cleanup_(lookup_paths_free) LookupPaths lp = {};
_cleanup_strv_free_ char **names = NULL;
sd_bus *bus;
EditFileContext *context,
char **names) {
- _cleanup_(hashmap_freep) Hashmap *cached_name_map = NULL, *cached_id_map = NULL;
+ _cleanup_hashmap_free_ Hashmap *cached_name_map = NULL, *cached_id_map = NULL;
_cleanup_(lookup_paths_free) LookupPaths lp = {};
_cleanup_free_ char *drop_in_alloc = NULL, *suffix = NULL;
const char *drop_in;
int verb_list_unit_files(int argc, char *argv[], void *userdata) {
_cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
_cleanup_free_ UnitFileList *units = NULL;
- _cleanup_(hashmap_freep) Hashmap *h = NULL;
+ _cleanup_hashmap_free_ Hashmap *h = NULL;
unsigned c = 0;
const char *state;
char *path;
Resource *rr,
mode_t m) {
- _cleanup_(closedirp) DIR *d = NULL;
+ _cleanup_closedir_ DIR *d = NULL;
int r;
assert(rr);
size_t *ret_size) {
_cleanup_free_ char *buffer = NULL, *suffixed_url = NULL;
- _cleanup_(close_pairp) int pfd[2] = PIPE_EBADF;
+ _cleanup_close_pair_ int pfd[2] = PIPE_EBADF;
_cleanup_fclose_ FILE *manifest = NULL;
size_t size = 0;
pid_t pid;
}
static void transfer_remove_temporary(Transfer *t) {
- _cleanup_(closedirp) DIR *d = NULL;
+ _cleanup_closedir_ DIR *d = NULL;
int r;
assert(t);
static int verb_components(int argc, char **argv, void *userdata) {
_cleanup_(loop_device_unrefp) LoopDevice *loop_device = NULL;
_cleanup_(umount_and_rmdir_and_freep) char *mounted_dir = NULL;
- _cleanup_(set_freep) Set *names = NULL;
+ _cleanup_set_free_ Set *names = NULL;
_cleanup_free_ char **z = NULL; /* We use simple free() rather than strv_free() here, since set_free() will free the strings for us */
char **l = CONF_PATHS_STRV("");
bool has_default_component = false;
TEST(copy_data_fd) {
_cleanup_close_ int fd1 = -EBADF, fd2 = -EBADF;
- _cleanup_(close_pairp) int sfd[2] = PIPE_EBADF;
+ _cleanup_close_pair_ int sfd[2] = PIPE_EBADF;
_cleanup_(sigkill_waitp) pid_t pid = -1;
int r;
#include "tests.h"
TEST(hashmap_replace) {
- _cleanup_(hashmap_freep) Hashmap *m = NULL;
+ _cleanup_hashmap_free_ Hashmap *m = NULL;
_cleanup_free_ char *val1 = NULL, *val2 = NULL, *val3 = NULL, *val4 = NULL, *val5 = NULL;
char *r;
}
TEST(hashmap_copy) {
- _cleanup_(hashmap_freep) Hashmap *m = NULL;
- _cleanup_(hashmap_free_freep) Hashmap *copy = NULL;
+ _cleanup_hashmap_free_ Hashmap *m = NULL;
+ _cleanup_hashmap_free_free_ Hashmap *copy = NULL;
char *val1, *val2, *val3, *val4, *r;
val1 = strdup("val1");
}
TEST(hashmap_get_strv) {
- _cleanup_(hashmap_freep) Hashmap *m = NULL;
- _cleanup_(strv_freep) char **strv = NULL;
+ _cleanup_hashmap_free_ Hashmap *m = NULL;
+ _cleanup_strv_free_ char **strv = NULL;
char *val1, *val2, *val3, *val4;
val1 = strdup("val1");
}
TEST(hashmap_move_one) {
- _cleanup_(hashmap_free_freep) Hashmap *m = NULL, *n = NULL;
+ _cleanup_hashmap_free_free_ Hashmap *m = NULL, *n = NULL;
char *val1, *val2, *val3, *val4, *r;
val1 = strdup("val1");
}
TEST(hashmap_move) {
- _cleanup_(hashmap_free_freep) Hashmap *m = NULL, *n = NULL;
+ _cleanup_hashmap_free_free_ Hashmap *m = NULL, *n = NULL;
char *val1, *val2, *val3, *val4, *r;
val1 = strdup("val1");
}
TEST(hashmap_update) {
- _cleanup_(hashmap_freep) Hashmap *m = NULL;
+ _cleanup_hashmap_free_ Hashmap *m = NULL;
_cleanup_free_ char *val1 = NULL, *val2 = NULL;
char *r;
}
TEST(hashmap_put) {
- _cleanup_(hashmap_freep) Hashmap *m = NULL;
+ _cleanup_hashmap_free_ Hashmap *m = NULL;
int valid_hashmap_put;
void *val1 = (void*) "val 1";
void *val2 = (void*) "val 2";
}
TEST(hashmap_foreach_key) {
- _cleanup_(hashmap_freep) Hashmap *m = NULL;
+ _cleanup_hashmap_free_ Hashmap *m = NULL;
bool key_found[] = { false, false, false, false };
const char *s;
const char *key;
}
TEST(hashmap_foreach) {
- _cleanup_(hashmap_free_freep) Hashmap *m = NULL;
+ _cleanup_hashmap_free_free_ Hashmap *m = NULL;
bool value_found[] = { false, false, false, false };
char *val1, *val2, *val3, *val4, *s;
unsigned count;
}
TEST(hashmap_merge) {
- _cleanup_(hashmap_free_freep) Hashmap *m = NULL;
- _cleanup_(hashmap_freep) Hashmap *n = NULL;
+ _cleanup_hashmap_free_free_ Hashmap *m = NULL;
+ _cleanup_hashmap_free_ Hashmap *n = NULL;
char *val1, *val2, *val3, *val4, *r;
val1 = strdup("my val1");
}
TEST(hashmap_contains) {
- _cleanup_(hashmap_free_freep) Hashmap *m = NULL;
+ _cleanup_hashmap_free_free_ Hashmap *m = NULL;
char *val1;
val1 = strdup("my val");
}
TEST(hashmap_isempty) {
- _cleanup_(hashmap_free_freep) Hashmap *m = NULL;
+ _cleanup_hashmap_free_free_ Hashmap *m = NULL;
char *val1;
val1 = strdup("my val");
}
TEST(hashmap_size) {
- _cleanup_(hashmap_free_freep) Hashmap *m = NULL;
+ _cleanup_hashmap_free_free_ Hashmap *m = NULL;
char *val1, *val2, *val3, *val4;
val1 = strdup("my val");
}
TEST(hashmap_get) {
- _cleanup_(hashmap_free_freep) Hashmap *m = NULL;
+ _cleanup_hashmap_free_free_ Hashmap *m = NULL;
char *r;
char *val;
UnitFileState state;
bool got_yes = false, got_no = false;
UnitFileList *fl;
- _cleanup_(hashmap_freep) Hashmap *h = NULL;
+ _cleanup_hashmap_free_ Hashmap *h = NULL;
CLEANUP_ARRAY(changes, n_changes, install_changes_free);
}
int main(int argc, char* argv[]) {
- _cleanup_(hashmap_freep) Hashmap *h = NULL;
+ _cleanup_hashmap_free_ Hashmap *h = NULL;
UnitFileList *p;
int r;
const char *const files[] = { "avahi-daemon.service", NULL };
TEST_RET(unit_file_get_set) {
int r;
- _cleanup_(hashmap_freep) Hashmap *h = NULL;
+ _cleanup_hashmap_free_ Hashmap *h = NULL;
UnitFileList *p;
h = hashmap_new(&unit_file_list_hash_ops_free);
sd_id128_t id;
#endif
_cleanup_free_ char *p = NULL, *cmd = NULL;
- _cleanup_(pclosep) FILE *sfdisk = NULL;
+ _cleanup_pclose_ FILE *sfdisk = NULL;
_cleanup_(loop_device_unrefp) LoopDevice *loop = NULL;
_cleanup_close_ int fd = -EBADF;
int r;
}
TEST(set_copy) {
- _cleanup_(set_freep) Set *s = NULL;
- _cleanup_(set_free_freep) Set *copy = NULL;
+ _cleanup_set_free_ Set *s = NULL;
+ _cleanup_set_free_free_ Set *copy = NULL;
char *key1, *key2, *key3, *key4;
key1 = strdup("key1");
}
TEST(strv_split) {
- _cleanup_(strv_free_erasep) char **l = NULL;
+ _cleanup_strv_free_erase_ char **l = NULL;
const char str[] = "one,two,three";
l = strv_split(str, ",");
_cleanup_(rm_rf_physical_and_freep) char *tmpdir = NULL;
_cleanup_(json_variant_unrefp) JsonVariant *v = NULL;
_cleanup_(sd_event_unrefp) sd_event *e = NULL;
- _cleanup_(close_pairp) int block_fds[2] = PIPE_EBADF;
+ _cleanup_close_pair_ int block_fds[2] = PIPE_EBADF;
pthread_t t;
const char *sp;
}
static int populate_uid_cache(const char *root, Hashmap **ret) {
- _cleanup_(hashmap_freep) Hashmap *cache = NULL;
+ _cleanup_hashmap_free_ Hashmap *cache = NULL;
int r;
cache = hashmap_new(&uid_gid_hash_ops);
}
static int populate_gid_cache(const char *root, Hashmap **ret) {
- _cleanup_(hashmap_freep) Hashmap *cache = NULL;
+ _cleanup_hashmap_free_ Hashmap *cache = NULL;
int r;
cache = hashmap_new(&uid_gid_hash_ops);
log_info("/* %s(\"%s\") */", __func__, name);
- _cleanup_(hashmap_freep) Hashmap *uid_cache = NULL, *gid_cache = NULL;
+ _cleanup_hashmap_free_ Hashmap *uid_cache = NULL, *gid_cache = NULL;
uid_t uid = UID_INVALID;
gid_t gid = GID_INVALID;
int r;
bool ignore_enoent,
bool *invalid_config) {
- _cleanup_(hashmap_freep) Hashmap *uid_cache = NULL, *gid_cache = NULL;
+ _cleanup_hashmap_free_ Hashmap *uid_cache = NULL, *gid_cache = NULL;
_cleanup_fclose_ FILE *_f = NULL;
_cleanup_free_ char *pp = NULL;
unsigned v = 0;
}
int lock_main(int argc, char *argv[], void *userdata) {
- _cleanup_(fdset_freep) FDSet *fds = NULL;
+ _cleanup_fdset_free_ FDSet *fds = NULL;
_cleanup_free_ dev_t *devnos = NULL;
size_t n_devnos = 0;
usec_t deadline;
static int display_services(int argc, char *argv[], void *userdata) {
_cleanup_(table_unrefp) Table *t = NULL;
- _cleanup_(closedirp) DIR *d = NULL;
+ _cleanup_closedir_ DIR *d = NULL;
int r;
d = opendir("/run/systemd/userdb/");
}
static int run(const char *dest, const char *dest_early, const char *dest_late) {
- _cleanup_(hashmap_freep) Hashmap *all_services = NULL;
+ _cleanup_hashmap_free_ Hashmap *all_services = NULL;
XdgAutostartService *service;
int r;