summaryrefslogtreecommitdiff
path: root/src/analyze
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-10-11 19:34:17 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-10-13 17:56:54 -0400
commit872c8faaf2009422a91d227ae0b5c6f04c9d2c69 (patch)
treea6b03abbcd801638098ec591f48873b39f6a0dcd /src/analyze
parent51d122af23533b0b8318911c4fc8b128ad8eafb7 (diff)
Fix write-only use of a few variables
Since the invention of read-only memory, write-only memory has been considered deprecated. Where appropriate, either make use of the value, or avoid writing it, to make it clear that it is not used.
Diffstat (limited to 'src/analyze')
-rw-r--r--src/analyze/systemd-analyze.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/analyze/systemd-analyze.c b/src/analyze/systemd-analyze.c
index a4f15eb646..26769d6c37 100644
--- a/src/analyze/systemd-analyze.c
+++ b/src/analyze/systemd-analyze.c
@@ -384,9 +384,9 @@ static int pretty_boot_time(DBusConnection *bus, char **_buf) {
size = strpcpyf(&ptr, size, "%s (userspace) ", format_timespan(ts, sizeof(ts), t->finish_time - t->userspace_time, USEC_PER_MSEC));
if (t->kernel_time > 0)
- size = strpcpyf(&ptr, size, "= %s", format_timespan(ts, sizeof(ts), t->firmware_time + t->finish_time, USEC_PER_MSEC));
+ strpcpyf(&ptr, size, "= %s", format_timespan(ts, sizeof(ts), t->firmware_time + t->finish_time, USEC_PER_MSEC));
else
- size = strpcpyf(&ptr, size, "= %s", format_timespan(ts, sizeof(ts), t->finish_time - t->userspace_time, USEC_PER_MSEC));
+ strpcpyf(&ptr, size, "= %s", format_timespan(ts, sizeof(ts), t->finish_time - t->userspace_time, USEC_PER_MSEC));
ptr = strdup(buf);
if (!ptr)
@@ -818,18 +818,18 @@ static int list_dependencies_one(DBusConnection *bus, const char *name, unsigned
if (strv_contains(*units, *c)) {
r = list_dependencies_print("...", level + 1, (branches << 1) | (to_print ? 1 : 0),
true, NULL, boot);
+ if (r < 0)
+ return r;
continue;
}
r = list_dependencies_one(bus, *c, level + 1, units,
(branches << 1) | (to_print ? 1 : 0));
- if(r < 0)
+ if (r < 0)
return r;
-
- if(!to_print)
+ if (!to_print)
break;
-
}
return 0;
}