chiark / gitweb /
path_lookup: moved _cleanup_lookup_paths_free_ from install.c to path-lookup.h
authorDaniel Buch <boogiewasthere@gmail.com>
Sun, 27 Oct 2013 11:45:52 +0000 (12:45 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 27 Oct 2013 15:51:22 +0000 (11:51 -0400)
src/shared/install.c
src/shared/path-lookup.h
src/systemctl/systemctl.c

index 3bced1a5eeb830910b58bc58b74e5475c3f01bc7..987b36d40b4eba187dc2e11d435d10be3344b1c9 100644 (file)
@@ -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) {
index 9dee85f9673d113983b741085197406c8593d04d..a3ef824a8603e42e59775bc3fdaa8d7ad5434b8e 100644 (file)
@@ -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_;
 
index d458c6588dda0ff13900816bd3bf07be2476187a..87a6985cc983f3f8cd86f3216226faa601bf3af8 100644 (file)
@@ -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++) {