]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
analyze: add some logging to some error cases
authorLennart Poettering <lennart@poettering.net>
Tue, 26 Dec 2017 15:01:14 +0000 (16:01 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 26 Dec 2017 15:04:10 +0000 (16:04 +0100)
src/analyze/analyze.c

index 16eba2d90f941dc1bc56ffed1c6b8db9fc97b81d..ec2504a1c03787a18170620db8fcc07cd5a4d3ff 100644 (file)
@@ -1007,12 +1007,12 @@ static int analyze_critical_chain(int argc, char *argv[], void *userdata) {
 
         h = hashmap_new(&string_hash_ops);
         if (!h)
-                return -ENOMEM;
+                return log_oom();
 
-        for (i = 0; i < (unsigned)n; i++) {
+        for (i = 0; i < (unsigned) n; i++) {
                 r = hashmap_put(h, times[i].name, &times[i]);
                 if (r < 0)
-                        return r;
+                        return log_error_errno(r, "Failed to add entry to hashmap: %m");
         }
         unit_times_hashmap = h;