[systemd-commits] 2 commits - src/analyze

Lennart Poettering lennart at kemper.freedesktop.org
Wed Nov 6 16:39:28 CET 2013


 src/analyze/analyze.c |   28 ++++++++++++----------------
 1 file changed, 12 insertions(+), 16 deletions(-)

New commits:
commit d3eba116d14b8775eed02e433f7ec5f62cde4957
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Nov 6 16:38:21 2013 +0100

    analyze: simplify things

diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c
index b596cad..9becc72 100644
--- a/src/analyze/analyze.c
+++ b/src/analyze/analyze.c
@@ -1123,7 +1123,6 @@ static int dump(sd_bus *bus, char **args) {
 static int set_log_level(sd_bus *bus, char **args) {
         _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
         int r;
-        const char* value;
 
         assert(bus);
         assert(args);
@@ -1133,8 +1132,6 @@ static int set_log_level(sd_bus *bus, char **args) {
                 return -E2BIG;
         }
 
-        value = args[0];
-
         r = sd_bus_set_property(
                         bus,
                         "org.freedesktop.systemd1",
@@ -1143,7 +1140,7 @@ static int set_log_level(sd_bus *bus, char **args) {
                         "LogLevel",
                         &error,
                         "s",
-                        value);
+                        args[0]);
         if (r < 0) {
                 log_error("Failed to issue method call: %s", bus_error_message(&error, -r));
                 return -EIO;

commit 07d0eaa0171d6e30b85a4b84b3287509406f9451
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Nov 6 16:38:08 2013 +0100

    analyze: fix indentation

diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c
index e278a64..b596cad 100644
--- a/src/analyze/analyze.c
+++ b/src/analyze/analyze.c
@@ -218,7 +218,7 @@ static int bus_get_unit_property_strv(sd_bus *bus, const char *unit_path, const
 
         r = sd_bus_message_enter_container(reply, SD_BUS_TYPE_ARRAY, "s");
         if (r < 0)
-            return r;
+                return r;
 
         while ((r = sd_bus_message_read(reply, "s", &s)) > 0) {
                 r = strv_extend(strv, s);
@@ -248,19 +248,19 @@ static int acquire_time_data(sd_bus *bus, struct unit_times **out) {
                        &reply,
                        "");
         if (r < 0) {
-            log_error("Failed to parse reply: %s", bus_error_message(&error, -r));
-            goto fail;
+                log_error("Failed to parse reply: %s", bus_error_message(&error, -r));
+                goto fail;
         }
 
         r = sd_bus_message_enter_container(reply, SD_BUS_TYPE_ARRAY, "(ssssssouso)");
         if (r < 0)
-            goto fail;
+                goto fail;
 
         while ((r = bus_parse_unit_info(reply, &u)) > 0) {
                 struct unit_times *t;
 
                 if (r < 0)
-                    goto fail;
+                        goto fail;
 
                 if (c >= n_units) {
                         struct unit_times *w;
@@ -950,9 +950,8 @@ static int graph_one_property(sd_bus *bus, const struct unit_info *u, const char
         assert(color);
 
         r = bus_get_unit_property_strv(bus, u->unit_path, prop, &units);
-        if (r < 0) {
-            return -r;
-        }
+        if (r < 0)
+                return -r;
 
         STRV_FOREACH(unit, units) {
                 char **p;
@@ -1107,14 +1106,14 @@ static int dump(sd_bus *bus, char **args) {
                        &reply,
                        "");
         if (r < 0) {
-            log_error("Failed to parse reply: %s", bus_error_message(&error, -r));
-            return r;
+                log_error("Failed to parse reply: %s", bus_error_message(&error, -r));
+                return r;
         }
 
         r = sd_bus_message_read(reply, "s", &text);
         if (r < 0) {
-            log_error("Failed to parse reply");
-            return r;
+                log_error("Failed to parse reply");
+                return r;
         }
 
         fputs(text, stdout);



More information about the systemd-commits mailing list