chiark / gitweb /
bus-proxyd: explicitly address messages to unique and well-known name
[elogind.git] / src / sysv-generator / sysv-generator.c
index 6c3281ff1520dcf470fc2366dba47a0b86ac30a9..6e4cdd694e5a877957d8e7bb980e531eea861ab0 100644 (file)
@@ -31,7 +31,6 @@
 #include "path-util.h"
 #include "path-lookup.h"
 #include "log.h"
 #include "path-util.h"
 #include "path-lookup.h"
 #include "log.h"
-#include "strv.h"
 #include "unit.h"
 #include "unit-name.h"
 #include "special.h"
 #include "unit.h"
 #include "unit-name.h"
 #include "special.h"
@@ -114,9 +113,9 @@ static int add_symlink(const char *service, const char *where) {
 }
 
 static int generate_unit_file(SysvStub *s) {
 }
 
 static int generate_unit_file(SysvStub *s) {
-        char *unit;
         char **p;
         _cleanup_fclose_ FILE *f = NULL;
         char **p;
         _cleanup_fclose_ FILE *f = NULL;
+        _cleanup_free_ char *unit = NULL;
         _cleanup_free_ char *before = NULL;
         _cleanup_free_ char *after = NULL;
         _cleanup_free_ char *wants = NULL;
         _cleanup_free_ char *before = NULL;
         _cleanup_free_ char *after = NULL;
         _cleanup_free_ char *wants = NULL;
@@ -810,9 +809,8 @@ static int set_dependencies_from_rcnd(LookupPaths lp, Hashmap *all_services) {
                                         goto finish;
                                 }
 
                                         goto finish;
                                 }
 
-                                if (hashmap_contains(all_services, name))
-                                        service = hashmap_get(all_services, name);
-                                else {
+                                service = hashmap_get(all_services, name);
+                                if (!service){
                                         log_warning("Could not find init script for %s", name);
                                         continue;
                                 }
                                         log_warning("Could not find init script for %s", name);
                                         continue;
                                 }