chiark / gitweb /
coredump: simplify a few things by allocating small fields on the stack rather than...
[elogind.git] / src / core / load-dropin.c
index 8da4adc9a20b0ef23e3302a590eeba732b46802f..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_errno(k, "Failed to read directory %s: %m", path);
-                        return -k;
-                }
+                if (!de && errno != 0)
+                        return log_error_errno(errno, "Failed to read directory %s: %m", path);
 
                 if (!de)
                         break;