Fix bootctl status to not print strange glyphs in logs (#36745)

This commit is contained in:
Yu Watanabe
2025-03-16 05:56:55 +09:00
committed by GitHub
107 changed files with 561 additions and 550 deletions
+3 -3
View File
@@ -232,9 +232,9 @@ static int format_config_files(char ***files, const char *main_config) {
STRV_FOREACH(d, *files) {
_cleanup_free_ char *s = NULL;
int glyph = *(d + 1) == NULL ? SPECIAL_GLYPH_TREE_RIGHT : SPECIAL_GLYPH_TREE_BRANCH;
Glyph tree = *(d + 1) == NULL ? GLYPH_TREE_RIGHT : GLYPH_TREE_BRANCH;
s = strjoin(special_glyph(glyph), *d);
s = strjoin(glyph(tree), *d);
if (!s)
return log_oom();
@@ -918,7 +918,7 @@ static int link_status_one(
/* First line: circle, ifindex, ifname. */
printf("%s%s%s %d: %s\n",
on_color_operational, special_glyph(SPECIAL_GLYPH_BLACK_CIRCLE), off_color_operational,
on_color_operational, glyph(GLYPH_BLACK_CIRCLE), off_color_operational,
info->ifindex, info->name);
r = table_print(table, NULL);
+1 -1
View File
@@ -116,7 +116,7 @@ int system_status(sd_netlink *rtnl, sd_hwdb *hwdb) {
return r;
printf("%s%s%s Interfaces: %s\n",
on_color_operational, special_glyph(SPECIAL_GLYPH_BLACK_CIRCLE), off_color_operational,
on_color_operational, glyph(GLYPH_BLACK_CIRCLE), off_color_operational,
strna(netifs_joined));
r = table_print(table, NULL);
+3 -3
View File
@@ -2215,7 +2215,7 @@ static int link_update_master(Link *link, sd_netlink_message *message) {
log_link_debug(link, "Detached from master interface: %i", link->master_ifindex);
else
log_link_debug(link, "Master interface changed: %i %s %i", link->master_ifindex,
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), master_ifindex);
glyph(GLYPH_ARROW_RIGHT), master_ifindex);
link_drop_from_master(link);
link->master_ifindex = master_ifindex;
@@ -2358,7 +2358,7 @@ static int link_update_hardware_address(Link *link, sd_netlink_message *message)
else {
log_link_debug(link, "Hardware address is changed: %s %s %s",
HW_ADDR_TO_STR(&link->hw_addr),
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT),
glyph(GLYPH_ARROW_RIGHT),
HW_ADDR_TO_STR(&addr));
hashmap_remove_value(link->manager->links_by_hw_addr, &link->hw_addr, link);
@@ -2456,7 +2456,7 @@ static int link_update_mtu(Link *link, sd_netlink_message *message) {
if (link->mtu != 0)
log_link_debug(link, "MTU is changed: %"PRIu32" %s %"PRIu32" (min: %"PRIu32", max: %"PRIu32")",
link->mtu, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), mtu,
link->mtu, glyph(GLYPH_ARROW_RIGHT), mtu,
link->min_mtu, link->max_mtu);
link->mtu = mtu;