diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-06-28 20:36:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-28 20:36:35 +0200 |
commit | d5548eb618d426a3952746eb3a0e7d95d186ea7e (patch) | |
tree | cdfaaae4fe14b888a304febfecd4922e8ffa427e /src/udev | |
parent | Merge pull request #23849 from mbiebl/more-https (diff) | |
parent | tree-wide: allow ASCII fallback for … in logs (diff) | |
download | systemd-d5548eb618d426a3952746eb3a0e7d95d186ea7e.tar.xz systemd-d5548eb618d426a3952746eb3a0e7d95d186ea7e.zip |
Merge pull request #23821 from dtardon/ascii-logging
Allow ASCII fallback for Unicode characters in logs
Diffstat (limited to 'src/udev')
-rw-r--r-- | src/udev/udev-builtin-net_id.c | 36 | ||||
-rw-r--r-- | src/udev/udevadm-lock.c | 9 |
2 files changed, 26 insertions, 19 deletions
diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c index f2ea2a7cd5..59db7641b5 100644 --- a/src/udev/udev-builtin-net_id.c +++ b/src/udev/udev-builtin-net_id.c @@ -28,6 +28,7 @@ #include "dirent-util.h" #include "fd-util.h" #include "fileio.h" +#include "glyph-util.h" #include "netif-naming-scheme.h" #include "parse-util.h" #include "proc-cmdline.h" @@ -215,9 +216,9 @@ static int dev_pci_onboard(sd_device *dev, const LinkInfo *info, NetNames *names l = strpcpyf(&s, l, "d%lu", dev_port); if (l == 0) names->pci_onboard[0] = '\0'; - log_device_debug(dev, "Onboard index identifier: index=%lu phys_port=%s dev_port=%lu → %s", + log_device_debug(dev, "Onboard index identifier: index=%lu phys_port=%s dev_port=%lu %s %s", idx, strempty(info->phys_port_name), dev_port, - empty_to_na(names->pci_onboard)); + special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), empty_to_na(names->pci_onboard)); if (sd_device_get_sysattr_value(names->pcidev, "label", &names->pci_onboard_label) >= 0) log_device_debug(dev, "Onboard label from PCI device: %s", names->pci_onboard_label); @@ -393,9 +394,9 @@ static int dev_pci_slot(sd_device *dev, const LinkInfo *info, NetNames *names) { if (l == 0) names->pci_path[0] = '\0'; - log_device_debug(dev, "PCI path identifier: domain=%u bus=%u slot=%u func=%u phys_port=%s dev_port=%lu → %s", + log_device_debug(dev, "PCI path identifier: domain=%u bus=%u slot=%u func=%u phys_port=%s dev_port=%lu %s %s", domain, bus, slot, func, strempty(info->phys_port_name), dev_port, - empty_to_na(names->pci_path)); + special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), empty_to_na(names->pci_path)); /* ACPI _SUN — slot user number */ r = sd_device_new_from_subsystem_sysname(&pci, "subsystem", "pci"); @@ -487,9 +488,9 @@ static int dev_pci_slot(sd_device *dev, const LinkInfo *info, NetNames *names) { if (l == 0) names->pci_slot[0] = '\0'; - log_device_debug(dev, "Slot identifier: domain=%u slot=%"PRIu32" func=%u phys_port=%s dev_port=%lu → %s", + log_device_debug(dev, "Slot identifier: domain=%u slot=%"PRIu32" func=%u phys_port=%s dev_port=%lu %s %s", domain, hotplug_slot, func, strempty(info->phys_port_name), dev_port, - empty_to_na(names->pci_slot)); + special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), empty_to_na(names->pci_slot)); } return 0; @@ -529,7 +530,8 @@ static int names_vio(sd_device *dev, NetNames *names) { xsprintf(names->vio_slot, "v%u", slotid); names->type = NET_VIO; - log_device_debug(dev, "Vio slot identifier: slotid=%u → %s", slotid, names->vio_slot); + log_device_debug(dev, "Vio slot identifier: slotid=%u %s %s", + slotid, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), names->vio_slot); return 0; } @@ -596,8 +598,8 @@ static int names_platform(sd_device *dev, NetNames *names, bool test) { xsprintf(names->platform_path, "a%s%xi%u", vendor, model, instance); names->type = NET_PLATFORM; - log_device_debug(dev, "Platform identifier: vendor=%s model=%u instance=%u → %s", - vendor, model, instance, names->platform_path); + log_device_debug(dev, "Platform identifier: vendor=%s model=%u instance=%u %s %s", + vendor, model, instance, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), names->platform_path); return 0; } @@ -718,8 +720,9 @@ static int names_usb(sd_device *dev, NetNames *names) { if (l == 0) return log_device_debug_errno(dev, SYNTHETIC_ERRNO(ENAMETOOLONG), "Generated USB name would be too long."); - log_device_debug(dev, "USB name identifier: ports=%.*s config=%s interface=%s → %s", - (int) strlen(ports), sysname + (ports - name), config, interf, names->usb_ports); + log_device_debug(dev, "USB name identifier: ports=%.*s config=%s interface=%s %s %s", + (int) strlen(ports), sysname + (ports - name), config, interf, + special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), names->usb_ports); names->type = NET_USB; return 0; } @@ -752,7 +755,8 @@ static int names_bcma(sd_device *dev, NetNames *names) { xsprintf(names->bcma_core, "b%u", core); names->type = NET_BCMA; - log_device_debug(dev, "BCMA core identifier: core=%u → \"%s\"", core, names->bcma_core); + log_device_debug(dev, "BCMA core identifier: core=%u %s \"%s\"", + core, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), names->bcma_core); return 0; } @@ -813,7 +817,8 @@ static int names_ccw(sd_device *dev, NetNames *names) { return log_device_debug_errno(dev, SYNTHETIC_ERRNO(ENAMETOOLONG), "Generated CCW name would be too long."); names->type = NET_CCW; - log_device_debug(dev, "CCW identifier: ccw_busid=%s → \"%s\"", bus_id, names->ccw_busid); + log_device_debug(dev, "CCW identifier: ccw_busid=%s %s \"%s\"", + bus_id, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), names->ccw_busid); return 0; } @@ -1027,8 +1032,9 @@ static int builtin_net_id(sd_device *dev, sd_netlink **rtnl, int argc, char *arg xsprintf(str, "%sx%s", prefix, HW_ADDR_TO_STR_FULL(&info.hw_addr, HW_ADDR_TO_STRING_NO_COLON)); udev_builtin_add_property(dev, test, "ID_NET_NAME_MAC", str); - log_device_debug(dev, "MAC address identifier: hw_addr=%s → %s", - HW_ADDR_TO_STR(&info.hw_addr), str + strlen(prefix)); + log_device_debug(dev, "MAC address identifier: hw_addr=%s %s %s", + HW_ADDR_TO_STR(&info.hw_addr), + special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), str + strlen(prefix)); ieee_oui(dev, &info, test); } diff --git a/src/udev/udevadm-lock.c b/src/udev/udevadm-lock.c index 32935e8aa4..60d6507aaf 100644 --- a/src/udev/udevadm-lock.c +++ b/src/udev/udevadm-lock.c @@ -235,7 +235,7 @@ static int lock_device( if (deadline == USEC_INFINITY) { - log_info("Device '%s' is currently locked, waiting…", path); + log_info("Device '%s' is currently locked, waiting%s", path, special_glyph(SPECIAL_GLYPH_ELLIPSIS)); if (flock(fd, LOCK_EX) < 0) return log_error_errno(errno, "Failed to lock device '%s': %m", path); @@ -251,8 +251,9 @@ static int lock_device( * instead do the lock out-of-process: fork off a child that does the locking, and * that we'll wait on and kill if it takes too long. */ - log_info("Device '%s' is currently locked, waiting %s…", - path, FORMAT_TIMESPAN(usec_sub_unsigned(deadline, now(CLOCK_MONOTONIC)), 0)); + log_info("Device '%s' is currently locked, waiting %s%s", + path, FORMAT_TIMESPAN(usec_sub_unsigned(deadline, now(CLOCK_MONOTONIC)), 0), + special_glyph(SPECIAL_GLYPH_ELLIPSIS)); BLOCK_SIGNALS(SIGCHLD); @@ -311,7 +312,7 @@ static int lock_device( } } - log_debug("Successfully locked %s (%u:%u)…", path, major(devno), minor(devno)); + log_debug("Successfully locked %s (%u:%u)%s", path, major(devno), minor(devno), special_glyph(SPECIAL_GLYPH_ELLIPSIS)); return TAKE_FD(fd); } |