summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2012-02-09 10:36:56 +0100
committerMichal Schmidt <mschmidt@redhat.com>2012-02-09 10:36:56 +0100
commit81006b8ad8cfdbfdb418fc99918ee5c33eb5b35a (patch)
tree153f67c7e4550bb2ccbd140a3f658838f2c10314 /src
parentab5919fa1af147c2632fdae7bed4504c898a60af (diff)
install: fix incorrect 'Access denied' message with a non-existent unit
With "systemctl is-enabled non-existent.service" _UNIT_FILE_STATE_INVALID (-1) was wrongly interpreted as -errno. Return -ENOENT in this case. https://bugzilla.redhat.com/show_bug.cgi?id=766579
Diffstat (limited to 'src')
-rw-r--r--src/install.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/install.c b/src/install.c
index 1fb1f9d580..174d79bab6 100644
--- a/src/install.c
+++ b/src/install.c
@@ -1571,10 +1571,10 @@ UnitFileState unit_file_get_state(
}
if (lstat(path, &st) < 0) {
+ r = -errno;
if (errno == ENOENT)
continue;
- r = -errno;
goto finish;
}