]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sysv-generator: remove more dead code (#3462)
authorLennart Poettering <lennart@poettering.net>
Wed, 8 Jun 2016 08:18:56 +0000 (10:18 +0200)
committerMartin Pitt <martin.pitt@ubuntu.com>
Wed, 8 Jun 2016 08:18:56 +0000 (10:18 +0200)
The changes in 788d2b088b13a2444b9eb2ea82c0cc57d9f0980f weren't complete, only
half the code that dealt with K links was removed. This is a follow-up patch
that removes the rest too.

No functional changes.

src/sysv-generator/sysv-generator.c

index 4e12071e93985f647ebc910228541ad4754282fc..3ed8f23ff95cacfb351f6b478ba46dbf536393b0 100644 (file)
@@ -856,7 +856,7 @@ static int set_dependencies_from_rcnd(const LookupPaths *lp, Hashmap *all_servic
                                 _cleanup_free_ char *name = NULL, *fpath = NULL;
                                 int a, b;
 
-                                if (de->d_name[0] != 'S' && de->d_name[0] != 'K')
+                                if (de->d_name[0] != 'S')
                                         continue;
 
                                 if (strlen(de->d_name) < 4)
@@ -886,28 +886,23 @@ static int set_dependencies_from_rcnd(const LookupPaths *lp, Hashmap *all_servic
                                         continue;
                                 }
 
-                                if (de->d_name[0] == 'S')  {
+                                service->sysv_start_priority = MAX(a*10 + b, service->sysv_start_priority);
 
-                                        service->sysv_start_priority = MAX(a*10 + b, service->sysv_start_priority);
-
-                                        r = set_ensure_allocated(&runlevel_services[i], NULL);
-                                        if (r < 0) {
-                                                log_oom();
-                                                goto finish;
-                                        }
-
-                                        r = set_put(runlevel_services[i], service);
-                                        if (r < 0) {
-                                                log_oom();
-                                                goto finish;
-                                        }
+                                r = set_ensure_allocated(&runlevel_services[i], NULL);
+                                if (r < 0) {
+                                        log_oom();
+                                        goto finish;
+                                }
 
+                                r = set_put(runlevel_services[i], service);
+                                if (r < 0) {
+                                        log_oom();
+                                        goto finish;
                                 }
                         }
                 }
         }
 
-
         for (i = 0; i < ELEMENTSOF(rcnd_table); i ++)
                 SET_FOREACH(service, runlevel_services[i], j) {
                         r = strv_extend(&service->before, rcnd_table[i].target);