summaryrefslogtreecommitdiff
path: root/src/sysv-generator
diff options
context:
space:
mode:
Diffstat (limited to 'src/sysv-generator')
-rw-r--r--src/sysv-generator/sysv-generator.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c
index 714ce8f6cb..0c839c2c53 100644
--- a/src/sysv-generator/sysv-generator.c
+++ b/src/sysv-generator/sysv-generator.c
@@ -310,11 +310,13 @@ static int sysv_translate_facility(const char *name, const char *filename, char
* out whether something is a target or a service alias. */
if (*name == '$') {
- if (!unit_prefix_is_valid(n))
- return -EINVAL;
+ int k;
/* Facilities starting with $ are most likely targets */
- r = unit_name_build(n, NULL, ".target");
+ k = unit_name_build(n, NULL, ".target", &r);
+ if (k < 0)
+ return k;
+
} else if (streq_ptr(n, filename))
/* Names equaling the file name of the services are redundant */
return 0;