diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-08-21 16:15:49 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-08-21 17:24:21 +0200 |
commit | 4c94096027f21d4ed0efe991534a926d39d52369 (patch) | |
tree | 5e148edac536bc86ef4817f6ea986591c19e8096 /src/core/unit.c | |
parent | 5ed1227238724959f020169f5332086439709b55 (diff) |
core: unify how we generate the prefix string when dumping unit state
Diffstat (limited to 'src/core/unit.c')
-rw-r--r-- | src/core/unit.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/core/unit.c b/src/core/unit.c index 08e74b4160..56102b360d 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -791,7 +791,6 @@ void unit_dump(Unit *u, FILE *f, const char *prefix) { char *t, **j; UnitDependency d; Iterator i; - _cleanup_free_ char *p2 = NULL; const char *prefix2; char timestamp1[FORMAT_TIMESTAMP_MAX], @@ -806,10 +805,8 @@ void unit_dump(Unit *u, FILE *f, const char *prefix) { assert(u); assert(u->type >= 0); - if (!prefix) - prefix = ""; - p2 = strappend(prefix, "\t"); - prefix2 = p2 ? p2 : prefix; + prefix = strempty(prefix); + prefix2 = strappenda(prefix, "\t"); fprintf(f, "%s-> Unit %s:\n" |