mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-22 13:33:56 +03:00
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). ``` (cherry picked from commit7c35b78a0b
) (cherry picked from commit9ac0ad80fe
)
This commit is contained in:
parent
aa97e014fa
commit
0e7214c8b5
@ -592,12 +592,9 @@ static int add_names(
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
r = set_consume(*names, TAKE_PTR(inst));
|
r = add_name(unit_name, names, inst);
|
||||||
if (r > 0)
|
|
||||||
log_debug("Unit %s has alias %s.", unit_name, inst);
|
|
||||||
} else
|
} else
|
||||||
r = add_name(unit_name, names, *alias);
|
r = add_name(unit_name, names, *alias);
|
||||||
|
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user