]> err.no Git - systemd/commitdiff
service: shortcut sysv provides on ourselves
authorLennart Poettering <lennart@poettering.net>
Mon, 27 Sep 2010 22:29:09 +0000 (00:29 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 27 Sep 2010 22:29:09 +0000 (00:29 +0200)
src/service.c

index 6a4d350c9f4ab2f6b36821015b6691c1eecc2241..021bc86766978d0135f3d42b57e0dadec89231c6 100644 (file)
@@ -293,6 +293,7 @@ static int sysv_translate_facility(const char *name, char **_r) {
                 }
 
         if (*name == '$')
+                /* This is a heuristic. */
                 r = unit_name_build(name+1, NULL, ".target");
         else
                 r = sysv_translate_name(name);
@@ -585,6 +586,11 @@ static int service_load_sysv_path(Service *s, const char *path) {
                                                 goto finish;
                                         }
 
+                                        if (streq(n, file_name_from_path(path))) {
+                                                free(n);
+                                                continue;
+                                        }
+
                                         r = sysv_translate_facility(n, &m);
                                         free(n);
 
@@ -630,6 +636,11 @@ static int service_load_sysv_path(Service *s, const char *path) {
                                                 goto finish;
                                         }
 
+                                        if (streq(n, file_name_from_path(path))) {
+                                                free(n);
+                                                continue;
+                                        }
+
                                         r = sysv_translate_facility(n, &m);
                                         free(n);