X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=unit.c;h=a14e18ef5b18d05d9c11437b8154cd5c9d7fe006;hp=f1dc3ddf871db69be0805cc5afc3f79e487a90d6;hb=47be870bd83fb3719dffc3ee9348a409ab762a14;hpb=ea4309869e75497ba6a97c540646cb66a157a4d9 diff --git a/unit.c b/unit.c index f1dc3ddf8..a14e18ef5 100644 --- a/unit.c +++ b/unit.c @@ -1,5 +1,24 @@ /*-*- Mode: C; c-basic-offset: 8 -*-*/ +/*** + This file is part of systemd. + + Copyright 2010 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with systemd; If not, see . +***/ + #include #include #include @@ -332,15 +351,15 @@ void unit_dump(Unit *u, FILE *f, const char *prefix) { char *t; UnitDependency d; Iterator i; - char *prefix2; + char *p2; + const char *prefix2; assert(u); if (!prefix) prefix = ""; - prefix2 = strappend(prefix, "\t"); - if (!prefix2) - prefix2 = ""; + p2 = strappend(prefix, "\t"); + prefix2 = p2 ? p2 : prefix; fprintf(f, "%s→ Unit %s:\n" @@ -378,7 +397,7 @@ void unit_dump(Unit *u, FILE *f, const char *prefix) { if (u->meta.job) job_dump(u->meta.job, f, prefix2); - free(prefix2); + free(p2); } /* Common implementation for multiple backends */