chiark / gitweb /
service: fixup after ifdef dropping
[elogind.git] / src / core / service.c
index a4e419b7953f7db3bbe7bcc49675df222db17e80..70b93e8446b4d4a027089fb9ea54807e0a4d8a5f 100644 (file)
@@ -977,9 +977,9 @@ static int service_load_sysv_name(Service *s, const char *name) {
 
         /* For SysV services we strip the rc.* and *.sh
          * prefixes/suffixes. */
-        if (endswith(name, ".sh.service"))
+        if (startswith(name, "rc.") ||
+            endswith(name, ".sh.service"))
                 return -ENOENT;
-        if (startswith(name, "rc."))
 
         STRV_FOREACH(p, UNIT(s)->manager->lookup_paths.sysvinit_path) {
                 char *path;