chiark / gitweb /
networkctl: print the Gateway in the status output
[elogind.git] / src / core / load-dropin.c
index 0abac9584d54175d6dc4c11aa9884e8fe919c9ba..8afaf45fe6acb1a55603341e7c57dc0584130a98 100644 (file)
@@ -58,22 +58,18 @@ static int iterate_dir(
                 if (errno == ENOENT)
                         return 0;
 
-                log_error("Failed to open directory %s: %m", path);
+                log_error_errno(errno, "Failed to open directory %s: %m", path);
                 return -errno;
         }
 
         for (;;) {
                 struct dirent *de;
                 _cleanup_free_ char *f = NULL;
-                int k;
 
                 errno = 0;
                 de = readdir(d);
-                if (!de && errno != 0) {
-                        k = errno;
-                        log_error("Failed to read directory %s: %s", path, strerror(k));
-                        return -k;
-                }
+                if (!de && errno != 0)
+                        return log_error_errno(errno, "Failed to read directory %s: %m", path);
 
                 if (!de)
                         break;