[systemd-devel] [PATCH 1/2] path_lookup: moved _cleanup_lookup_paths_free_ from install.c to path-lookup.h

Daniel Buch boogiewasthere at gmail.com
Sun Oct 27 12:45:52 CET 2013


---
 src/shared/install.c      | 1 -
 src/shared/path-lookup.h  | 2 ++
 src/systemctl/systemctl.c | 4 +---
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/shared/install.c b/src/shared/install.c
index 3bced1a..987b36d 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -44,7 +44,6 @@ typedef struct {
         Hashmap *have_installed;
 } InstallContext;
 
-#define _cleanup_lookup_paths_free_ _cleanup_(lookup_paths_free)
 #define _cleanup_install_context_done_ _cleanup_(install_context_done)
 
 static int lookup_paths_init_from_scope(LookupPaths *paths, UnitFileScope scope) {
diff --git a/src/shared/path-lookup.h b/src/shared/path-lookup.h
index 9dee85f..a3ef824 100644
--- a/src/shared/path-lookup.h
+++ b/src/shared/path-lookup.h
@@ -36,6 +36,8 @@ typedef enum SystemdRunningAs {
         _SYSTEMD_RUNNING_AS_INVALID = -1
 } SystemdRunningAs;
 
+#define _cleanup_lookup_paths_free_ _cleanup_(lookup_paths_free)
+
 const char* systemd_running_as_to_string(SystemdRunningAs i) _const_;
 SystemdRunningAs systemd_running_as_from_string(const char *s) _pure_;
 
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index d458c65..87a6985 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -4223,7 +4223,7 @@ static int enable_sysv_units(const char *verb, char **args) {
 
 #if defined(HAVE_SYSV_COMPAT) && defined(HAVE_CHKCONFIG)
         unsigned f = 1, t = 1;
-        LookupPaths paths = {};
+        _cleanup_lookup_paths_free_ LookupPaths paths = {};
 
         if (arg_scope != UNIT_FILE_SYSTEM)
                 return 0;
@@ -4361,8 +4361,6 @@ static int enable_sysv_units(const char *verb, char **args) {
         }
 
 finish:
-        lookup_paths_free(&paths);
-
         /* Drop all SysV units */
         for (f = 0, t = 0; args[f]; f++) {
 
-- 
1.8.4.1



More information about the systemd-devel mailing list