Blob Blame History Raw
From 90489a2ccd14945919c8aa39127fb3495188ab5f Mon Sep 17 00:00:00 2001
From: Dave Reisner <dreisner@archlinux.org>
Date: Mon, 2 Apr 2012 09:08:35 -0400
Subject: [PATCH] install: check for proper return from dirent_ensure_type

Fixes 'systemctl list-unit-files', which previously returned only:

  Failed to issue method call: No such file or directory
(cherry picked from commit fb5ef067c493c5c59b72296d9c520be1dc54b79e)
---
 src/install.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/install.c b/src/install.c
index 174d79b..9256116 100644
--- a/src/install.c
+++ b/src/install.c
@@ -1853,7 +1853,7 @@ int unit_file_get_list(
 
                         r = dirent_ensure_type(d, de);
                         if (r < 0) {
-                                if (errno == ENOENT)
+                                if (r == -ENOENT)
                                         continue;
 
                                 goto finish;