summaryrefslogtreecommitdiff
path: root/src/sysv-generator/sysv-generator.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sysv-generator/sysv-generator.c')
-rw-r--r--src/sysv-generator/sysv-generator.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c
index e44304c16a..cae920eb3b 100644
--- a/src/sysv-generator/sysv-generator.c
+++ b/src/sysv-generator/sysv-generator.c
@@ -806,11 +806,11 @@ static int enumerate_sysv(const LookupPaths *lp, Hashmap *all_services) {
if (hashmap_contains(all_services, name))
continue;
- r = unit_file_lookup_state(UNIT_FILE_SYSTEM, lp, name, NULL);
- if (r < 0 && r != -ENOENT) {
+ r = unit_file_exists(UNIT_FILE_SYSTEM, lp, name);
+ if (r < 0) {
log_debug_errno(r, "Failed to detect whether %s exists, skipping: %m", name);
continue;
- } else if (r >= 0) {
+ } else if (r > 0) {
log_debug("Native unit for %s already exists, skipping.", name);
continue;
}