From 7fd1b19bc9e9f5574f2877936b8ac267c7706947 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 18 Apr 2013 09:11:22 +0200 Subject: move _cleanup_ attribute in front of the type http://lists.freedesktop.org/archives/systemd-devel/2013-April/010510.html --- src/core/dbus-socket.c | 2 +- src/core/dbus-unit.c | 4 ++-- src/core/execute.c | 8 ++++---- src/core/load-fragment.c | 16 ++++++++-------- src/core/loopback-setup.c | 4 ++-- src/core/main.c | 6 +++--- src/core/manager.c | 6 +++--- src/core/path.c | 2 +- src/core/service.c | 14 +++++++------- src/core/swap.c | 4 ++-- src/core/umount.c | 2 +- src/core/unit-printf.c | 2 +- 12 files changed, 35 insertions(+), 35 deletions(-) (limited to 'src/core') diff --git a/src/core/dbus-socket.c b/src/core/dbus-socket.c index 728958131d..77d98ea0fd 100644 --- a/src/core/dbus-socket.c +++ b/src/core/dbus-socket.c @@ -114,7 +114,7 @@ static int bus_socket_append_listen(DBusMessageIter *i, const char *property, vo LIST_FOREACH(port, p, s->ports) { const char *type = socket_port_type_to_string(p); - char _cleanup_free_ *address = NULL; + _cleanup_free_ char *address = NULL; const char *a; if (!dbus_message_iter_open_container(&array, DBUS_TYPE_STRUCT, NULL, &stru)) diff --git a/src/core/dbus-unit.c b/src/core/dbus-unit.c index 8c1ce61151..575f8eb36a 100644 --- a/src/core/dbus-unit.c +++ b/src/core/dbus-unit.c @@ -314,7 +314,7 @@ static int bus_unit_append_cgroups(DBusMessageIter *i, const char *property, voi return -ENOMEM; LIST_FOREACH(by_unit, cgb, u->cgroup_bondings) { - char _cleanup_free_ *t = NULL; + _cleanup_free_ char *t = NULL; bool success; t = cgroup_bonding_to_string(cgb); @@ -341,7 +341,7 @@ static int bus_unit_append_cgroup_attrs(DBusMessageIter *i, const char *property return -ENOMEM; LIST_FOREACH(by_unit, a, u->cgroup_attributes) { - char _cleanup_free_ *v = NULL; + _cleanup_free_ char *v = NULL; bool success; if (a->semantics && a->semantics->map_write) diff --git a/src/core/execute.c b/src/core/execute.c index 26cde24f15..5767037acd 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -997,7 +997,7 @@ int exec_spawn(ExecCommand *command, int r; char *line; int socket_fd; - char _cleanup_strv_free_ **files_env = NULL; + _cleanup_strv_free_ char **files_env = NULL; assert(command); assert(context); @@ -1069,7 +1069,7 @@ int exec_spawn(ExecCommand *command, const char *username = NULL, *home = NULL; uid_t uid = (uid_t) -1; gid_t gid = (gid_t) -1; - char _cleanup_strv_free_ **our_env = NULL, **pam_env = NULL, + _cleanup_strv_free_ char **our_env = NULL, **pam_env = NULL, **final_env = NULL, **final_argv = NULL; unsigned n_env = 0; bool set_access = false; @@ -1362,7 +1362,7 @@ int exec_spawn(ExecCommand *command, goto fail_child; } } else { - char _cleanup_free_ *d = NULL; + _cleanup_free_ char *d = NULL; if (asprintf(&d, "%s/%s", context->root_directory ? context->root_directory : "", @@ -1727,7 +1727,7 @@ int exec_context_load_environment(const ExecContext *c, char ***l) { int k; bool ignore = false; char **p; - glob_t _cleanup_globfree_ pglob = {}; + _cleanup_globfree_ glob_t pglob = {}; int count, n; fn = *i; diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index e71194301d..c3f4f92611 100644 --- a/src/core/load-fragment.c +++ b/src/core/load-fragment.c @@ -91,7 +91,7 @@ int config_parse_unit_deps(const char* unit, assert(rvalue); FOREACH_WORD_QUOTED(w, l, rvalue, state) { - char _cleanup_free_ *t = NULL, *k = NULL; + _cleanup_free_ char *t = NULL, *k = NULL; int r; t = strndup(w, l); @@ -785,7 +785,7 @@ int config_parse_exec_cpu_affinity(const char *unit, } FOREACH_WORD_QUOTED(w, l, rvalue, state) { - char _cleanup_free_ *t = NULL; + _cleanup_free_ char *t = NULL; int r; unsigned cpu; @@ -927,7 +927,7 @@ int config_parse_bounding_set(const char *unit, * interface. */ FOREACH_WORD_QUOTED(w, l, rvalue, state) { - char _cleanup_free_ *t = NULL; + _cleanup_free_ char *t = NULL; int r; cap_value_t cap; @@ -1019,7 +1019,7 @@ int config_parse_unit_cgroup(const char *unit, } FOREACH_WORD_QUOTED(w, l, rvalue, state) { - char _cleanup_free_ *t = NULL, *k = NULL, *ku = NULL; + _cleanup_free_ char *t = NULL, *k = NULL, *ku = NULL; int r; t = strndup(w, l); @@ -1161,7 +1161,7 @@ int config_parse_exec_mount_flags(const char *unit, assert(data); FOREACH_WORD_SEPARATOR(w, l, rvalue, ", ", state) { - char _cleanup_free_ *t; + _cleanup_free_ char *t; t = strndup(w, l); if (!t) @@ -1314,7 +1314,7 @@ int config_parse_path_spec(const char *unit, Path *p = data; PathSpec *s; PathType b; - char _cleanup_free_ *k = NULL; + _cleanup_free_ char *k = NULL; assert(filename); assert(lvalue); @@ -1480,7 +1480,7 @@ int config_parse_service_sockets(const char *unit, assert(data); FOREACH_WORD_QUOTED(w, l, rvalue, state) { - char _cleanup_free_ *t = NULL, *k = NULL; + _cleanup_free_ char *t = NULL, *k = NULL; t = strndup(w, l); if (!t) @@ -2074,7 +2074,7 @@ int config_parse_syscall_filter(const char *unit, FOREACH_WORD_QUOTED(w, l, rvalue, state) { int id; - char _cleanup_free_ *t = NULL; + _cleanup_free_ char *t = NULL; t = strndup(w, l); if (!t) diff --git a/src/core/loopback-setup.c b/src/core/loopback-setup.c index f98a29806e..aff24fa642 100644 --- a/src/core/loopback-setup.c +++ b/src/core/loopback-setup.c @@ -228,7 +228,7 @@ static int read_response(int fd, unsigned requests_max) { static int check_loopback(void) { int r; - int _cleanup_close_ fd; + _cleanup_close_ int fd; union { struct sockaddr sa; struct sockaddr_in in; @@ -261,7 +261,7 @@ int loopback_setup(void) { .nl.nl_family = AF_NETLINK, }; unsigned requests = 0, i; - int _cleanup_close_ fd = -1; + _cleanup_close_ int fd = -1; bool eperm = false; errno = 0; diff --git a/src/core/main.c b/src/core/main.c index 51c83154a5..ce8ec99f9b 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -666,7 +666,7 @@ static int parse_config_file(void) { { NULL, NULL, NULL, 0, NULL } }; - FILE _cleanup_fclose_ *f; + _cleanup_fclose_ FILE *f; const char *fn; int r; @@ -688,7 +688,7 @@ static int parse_config_file(void) { } static int parse_proc_cmdline(void) { - char _cleanup_free_ *line = NULL; + _cleanup_free_ char *line = NULL; char *w, *state; int r; size_t l; @@ -705,7 +705,7 @@ static int parse_proc_cmdline(void) { } FOREACH_WORD_QUOTED(w, l, line, state) { - char _cleanup_free_ *word; + _cleanup_free_ char *word; word = strndup(w, l); if (!word) diff --git a/src/core/manager.c b/src/core/manager.c index 1ee6a8ed53..208b240ba1 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -768,7 +768,7 @@ int manager_coldplug(Manager *m) { static void manager_build_unit_path_cache(Manager *m) { char **i; - DIR _cleanup_free_ *d = NULL; + _cleanup_free_ DIR *d = NULL; int r; assert(m); @@ -1191,7 +1191,7 @@ static int manager_process_notify_fd(Manager *m) { }; struct ucred *ucred; Unit *u; - char _cleanup_strv_free_ **tags = NULL; + _cleanup_strv_free_ char **tags = NULL; n = recvmsg(m->notify_watch.fd, &msghdr, MSG_DONTWAIT); if (n <= 0) { @@ -1264,7 +1264,7 @@ static int manager_dispatch_sigchld(Manager *m) { break; if (si.si_code == CLD_EXITED || si.si_code == CLD_KILLED || si.si_code == CLD_DUMPED) { - char _cleanup_free_ *name = NULL; + _cleanup_free_ char *name = NULL; get_process_comm(si.si_pid, &name); log_debug("Got SIGCHLD for process %lu (%s)", (unsigned long) si.si_pid, strna(name)); diff --git a/src/core/path.c b/src/core/path.c index b8ba057561..d5b5eeb4a1 100644 --- a/src/core/path.c +++ b/src/core/path.c @@ -156,7 +156,7 @@ void path_spec_unwatch(PathSpec *s, Unit *u) { } int path_spec_fd_event(PathSpec *s, uint32_t events) { - uint8_t _cleanup_free_ *buf = NULL; + _cleanup_free_ uint8_t *buf = NULL; struct inotify_event *e; ssize_t k; int l; diff --git a/src/core/service.c b/src/core/service.c index cf19ccb7b8..cf0bbe05fc 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -1275,7 +1275,7 @@ static void service_dump(Unit *u, FILE *f, const char *prefix) { ServiceExecCommand c; Service *s = SERVICE(u); const char *prefix2; - char _cleanup_free_ *p2 = NULL; + _cleanup_free_ char *p2 = NULL; assert(s); @@ -1373,7 +1373,7 @@ static void service_dump(Unit *u, FILE *f, const char *prefix) { } static int service_load_pid_file(Service *s, bool may_warn) { - char _cleanup_free_ *k = NULL; + _cleanup_free_ char *k = NULL; int r; pid_t pid; @@ -1740,9 +1740,9 @@ static int service_spawn( pid_t pid; int r; int *fds = NULL; - int _cleanup_free_ *fdsbuf = NULL; + _cleanup_free_ int *fdsbuf = NULL; unsigned n_fds = 0, n_env = 0; - char _cleanup_strv_free_ + _cleanup_strv_free_ char **argv = NULL, **final_env = NULL, **our_env = NULL; assert(s); @@ -3444,10 +3444,10 @@ static void service_notify_message(Unit *u, pid_t pid, char **tags) { static int service_enumerate(Manager *m) { char **p; unsigned i; - DIR _cleanup_closedir_ *d = NULL; - char _cleanup_free_ *path = NULL, *fpath = NULL, *name = NULL; + _cleanup_closedir_ DIR *d = NULL; + _cleanup_free_ char *path = NULL, *fpath = NULL, *name = NULL; Set *runlevel_services[ELEMENTSOF(rcnd_table)] = {}; - Set _cleanup_set_free_ *shutdown_services = NULL; + _cleanup_set_free_ Set *shutdown_services = NULL; Unit *service; Iterator j; int r; diff --git a/src/core/swap.c b/src/core/swap.c index b363c5ec09..e7cc19596e 100644 --- a/src/core/swap.c +++ b/src/core/swap.c @@ -214,7 +214,7 @@ static int swap_add_default_dependencies(Swap *s) { static int swap_verify(Swap *s) { bool b; - char _cleanup_free_ *e = NULL; + _cleanup_free_ char *e = NULL; if (UNIT(s)->load_state != UNIT_LOADED) return 0; @@ -315,7 +315,7 @@ static int swap_add_one( bool set_flags) { Unit *u = NULL; - char _cleanup_free_ *e = NULL; + _cleanup_free_ char *e = NULL; char *wp = NULL; bool delete = false; int r; diff --git a/src/core/umount.c b/src/core/umount.c index acfbbe5e03..1e95ad70dd 100644 --- a/src/core/umount.c +++ b/src/core/umount.c @@ -379,7 +379,7 @@ static int delete_loopback(const char *device) { } static int delete_dm(dev_t devnum) { - int _cleanup_close_ fd = -1; + _cleanup_close_ int fd = -1; int r; struct dm_ioctl dm = { .version = {DM_VERSION_MAJOR, diff --git a/src/core/unit-printf.c b/src/core/unit-printf.c index 98274ee35d..85a05b872a 100644 --- a/src/core/unit-printf.c +++ b/src/core/unit-printf.c @@ -124,7 +124,7 @@ static char *specifier_user_name(char specifier, void *data, void *userdata) { ExecContext *c; int r; const char *username; - char _cleanup_free_ *tmp = NULL; + _cleanup_free_ char *tmp = NULL; uid_t uid; char *printed = NULL; -- cgit v1.2.3-54-g00ecf