]> git.ipfire.org Git - thirdparty/systemd.git/commit
tree-wide: make format_ifname() or friends return negative errno on failure
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 28 Sep 2021 12:19:07 +0000 (21:19 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 28 Sep 2021 18:37:06 +0000 (03:37 +0900)
commit01afd0f7f53f7807294ce7c008ecf8a043a920fe
tree3aa92ca8449a2a4222aa51e6e9a36d3ca1f7d24a
parent1641c2b1123617f7be249bb7f2b2c408defb3b96
tree-wide: make format_ifname() or friends return negative errno on failure

Also,
- drop unnecessary +1 from buffer size, as IF_NAMESIZE or IFNAMSIZ
  includes the nul at the end.
- format_ifname() does not update buffer on failure,
- introduces format_ifname_alloc(), FORMAT_IFNAME(), and their friends.
13 files changed:
src/basic/format-util.c
src/basic/format-util.h
src/basic/socket-util.c
src/libsystemd-network/network-common.c
src/libsystemd/sd-device/sd-device.c
src/libsystemd/sd-netlink/netlink-util.c
src/machine/machinectl.c
src/network/networkctl.c
src/network/networkd-link.c
src/resolve/resolvectl.c
src/resolve/resolved-dns-cache.c
src/shared/format-table.c
src/test/test-nss-hosts.c