[systemd-commits] src/install.c

Michal Schmidt michich at kemper.freedesktop.org
Thu Feb 9 01:42:26 PST 2012


 src/install.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 81006b8ad8cfdbfdb418fc99918ee5c33eb5b35a
Author: Michal Schmidt <mschmidt at redhat.com>
Date:   Thu Feb 9 10:36:56 2012 +0100

    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

diff --git a/src/install.c b/src/install.c
index 1fb1f9d..174d79b 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;
                 }
 



More information about the systemd-commits mailing list