From: Yu Watanabe Date: Sat, 23 Jul 2022 03:48:35 +0000 (+0900) Subject: unit-file: avoid (null) in debugging logs X-Git-Tag: v252-rc1~592 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c35b78a0b96085e3d634542212c5521bc2a2f21;p=thirdparty%2Fsystemd.git unit-file: avoid (null) in debugging logs The variable `inst` was set to NULL by TAKE_PTR(). This fixes the following log message: ``` systemd[1]: Unit getty@tty2.service has alias (null). ``` --- diff --git a/src/basic/unit-file.c b/src/basic/unit-file.c index 43d35a23181..c81c69db305 100644 --- a/src/basic/unit-file.c +++ b/src/basic/unit-file.c @@ -697,12 +697,9 @@ static int add_names( continue; } - r = set_consume(*names, TAKE_PTR(inst)); - if (r > 0) - log_debug("Unit %s has alias %s.", unit_name, inst); + r = add_name(unit_name, names, inst); } else r = add_name(unit_name, names, *alias); - if (r < 0) return r; }