diff options
author | Jan Janssen <medhefgo@web.de> | 2022-08-29 13:07:11 +0200 |
---|---|---|
committer | Jan Janssen <medhefgo@web.de> | 2022-08-30 12:03:28 +0200 |
commit | c0f86d66f3f6b561528e7f856f9926bec766c036 (patch) | |
tree | b5b17ffb3a41a7974ff0ad35db009b4f8aa94116 | |
parent | Merge pull request #24474 from yuwata/udevadm-settle-cleanups (diff) | |
download | systemd-c0f86d66f3f6b561528e7f856f9926bec766c036.tar.xz systemd-c0f86d66f3f6b561528e7f856f9926bec766c036.zip |
tree-wide: Use correct format specifiers
gcc will complain about all these with -Wformat-signedness.
55 files changed, 102 insertions, 102 deletions
diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c index 33bde8b30e..c59eb62555 100644 --- a/src/boot/bootctl.c +++ b/src/boot/bootctl.c @@ -450,7 +450,7 @@ static const char *get_efi_arch(void) { if (r == -ENOENT) return EFI_MACHINE_TYPE_NAME; if (r < 0) { - log_warning_errno(r, "Error reading EFI firmware word size, assuming '%u': %m", __WORDSIZE); + log_warning_errno(r, "Error reading EFI firmware word size, assuming '%i': %m", __WORDSIZE); return EFI_MACHINE_TYPE_NAME; } @@ -460,7 +460,7 @@ static const char *get_efi_arch(void) { return "ia32"; log_warning( - "Unknown EFI firmware word size '%s', using default word size '%u' instead.", + "Unknown EFI firmware word size '%s', using default word size '%i' instead.", platform_size, __WORDSIZE); #endif diff --git a/src/core/automount.c b/src/core/automount.c index 39c716fb81..6c75d0e3ad 100644 --- a/src/core/automount.c +++ b/src/core/automount.c @@ -375,7 +375,7 @@ static int open_dev_autofs(Manager *m) { return -errno; } - log_debug("Autofs kernel version %i.%i", param.ver_major, param.ver_minor); + log_debug("Autofs kernel version %u.%u", param.ver_major, param.ver_minor); return m->dev_autofs_fd; } @@ -429,7 +429,7 @@ static int autofs_protocol(int dev_autofs_fd, int ioctl_fd) { minor = param.protosubver.sub_version; - log_debug("Autofs protocol version %i.%i", major, minor); + log_debug("Autofs protocol version %u.%u", major, minor); return 0; } diff --git a/src/core/bpf-socket-bind.c b/src/core/bpf-socket-bind.c index 3aa1bfa1f1..30e5b2f392 100644 --- a/src/core/bpf-socket-bind.c +++ b/src/core/bpf-socket-bind.c @@ -69,11 +69,11 @@ static int prepare_socket_bind_bpf( if (allow_count > SOCKET_BIND_MAX_RULES) return log_unit_full_errno(u, u ? LOG_ERR : LOG_WARNING, SYNTHETIC_ERRNO(EINVAL), - "bpf-socket-bind: Maximum number of socket bind rules=%u is exceeded", SOCKET_BIND_MAX_RULES); + "bpf-socket-bind: Maximum number of socket bind rules=%i is exceeded", SOCKET_BIND_MAX_RULES); if (deny_count > SOCKET_BIND_MAX_RULES) return log_unit_full_errno(u, u ? LOG_ERR : LOG_WARNING, SYNTHETIC_ERRNO(EINVAL), - "bpf-socket-bind: Maximum number of socket bind rules=%u is exceeded", SOCKET_BIND_MAX_RULES); + "bpf-socket-bind: Maximum number of socket bind rules=%i is exceeded", SOCKET_BIND_MAX_RULES); obj = socket_bind_bpf__open(); if (!obj) diff --git a/src/core/cgroup.c b/src/core/cgroup.c index c945f76abc..c0bb13caf3 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -1599,7 +1599,7 @@ static void cgroup_context_apply( if (unit_has_unified_memory_config(u)) { val = c->memory_max; - log_cgroup_compat(u, "Applying MemoryMax=%" PRIi64 " as MemoryLimit=", val); + log_cgroup_compat(u, "Applying MemoryMax=%" PRIu64 " as MemoryLimit=", val); } else val = c->memory_limit; diff --git a/src/core/manager.c b/src/core/manager.c index d21698a99b..510585198d 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -2763,7 +2763,7 @@ static int manager_dispatch_signal_fd(sd_event_source *source, int fd, uint32_t return log_error_errno(errno, "Reading from signal fd failed: %m"); } if (n != sizeof(sfsi)) { - log_warning("Truncated read from signal fd (%zu bytes), ignoring!", n); + log_warning("Truncated read from signal fd (%zi bytes), ignoring!", n); return 0; } diff --git a/src/core/service.c b/src/core/service.c index fa37207dcc..4933163b56 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -496,7 +496,7 @@ static int service_add_fd_store_set(Service *s, FDSet *fds, const char *name, bo if (r < 0) return log_unit_error_errno(UNIT(s), r, "Failed to add fd to store: %m"); if (r > 0) - log_unit_debug(UNIT(s), "Added fd %u (%s) to fd store.", fd, strna(name)); + log_unit_debug(UNIT(s), "Added fd %i (%s) to fd store.", fd, strna(name)); fd = -1; } diff --git a/src/core/unit.c b/src/core/unit.c index 05cee225ed..82a1d81e04 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -2263,7 +2263,7 @@ void unit_start_on_failure( } if (n_jobs >= 0) - log_unit_debug(u, "Triggering %s dependencies done (%u %s).", + log_unit_debug(u, "Triggering %s dependencies done (%i %s).", dependency_name, n_jobs, n_jobs == 1 ? "job" : "jobs"); } diff --git a/src/home/homework-mount.c b/src/home/homework-mount.c index a9c793c429..cd03f79a73 100644 --- a/src/home/homework-mount.c +++ b/src/home/homework-mount.c @@ -202,7 +202,7 @@ static int make_userns(uid_t stored_uid, uid_t exposed_uid) { return log_oom(); /* Now map the UID we are doing this for to the target UID. */ - r = strextendf(&text, UID_FMT " " UID_FMT " " UID_FMT "\n", stored_uid, exposed_uid, 1); + r = strextendf(&text, UID_FMT " " UID_FMT " " UID_FMT "\n", stored_uid, exposed_uid, 1u); if (r < 0) return log_oom(); @@ -221,7 +221,7 @@ static int make_userns(uid_t stored_uid, uid_t exposed_uid) { /* Map nspawn's mapped root UID as identity mapping so that people can run nspawn uidmap mounted * containers off $HOME, if they want. */ - r = strextendf(&text, UID_FMT " " UID_FMT " " UID_FMT "\n", UID_MAPPED_ROOT, UID_MAPPED_ROOT, 1); + r = strextendf(&text, UID_FMT " " UID_FMT " " UID_FMT "\n", UID_MAPPED_ROOT, UID_MAPPED_ROOT, 1u); if (r < 0) return log_oom(); diff --git a/src/journal-remote/journal-remote-parse.c b/src/journal-remote/journal-remote-parse.c index f8d068d6fe..27ab5e5ac6 100644 --- a/src/journal-remote/journal-remote-parse.c +++ b/src/journal-remote/journal-remote-parse.c @@ -13,7 +13,7 @@ void source_free(RemoteSource *source) { journal_importer_cleanup(&source->importer); - log_debug("Writer ref count %i", source->writer->n_ref); + log_debug("Writer ref count %u", source->writer->n_ref); writer_unref(source->writer); sd_event_source_unref(source->event); diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c index 3992d15664..b3a2df941c 100644 --- a/src/journal/journald-server.c +++ b/src/journal/journald-server.c @@ -1430,11 +1430,11 @@ static int dispatch_sigusr1(sd_event_source *es, const struct signalfd_siginfo * assert(s); if (s->namespace) { - log_error("Received SIGUSR1 signal from PID " PID_FMT ", but flushing runtime journals not supported for namespaced instances.", si->ssi_pid); + log_error("Received SIGUSR1 signal from PID %u, but flushing runtime journals not supported for namespaced instances.", si->ssi_pid); return 0; } - log_info("Received SIGUSR1 signal from PID " PID_FMT ", as request to flush runtime journal.", si->ssi_pid); + log_info("Received SIGUSR1 signal from PID %u, as request to flush runtime journal.", si->ssi_pid); server_full_flush(s); return 0; @@ -1466,7 +1466,7 @@ static int dispatch_sigusr2(sd_event_source *es, const struct signalfd_siginfo * assert(s); - log_info("Received SIGUSR2 signal from PID " PID_FMT ", as request to rotate journal, rotating.", si->ssi_pid); + log_info("Received SIGUSR2 signal from PID %u, as request to rotate journal, rotating.", si->ssi_pid); server_full_rotate(s); return 0; @@ -1575,7 +1575,7 @@ static int dispatch_sigrtmin1(sd_event_source *es, const struct signalfd_siginfo assert(s); - log_debug("Received SIGRTMIN1 signal from PID " PID_FMT ", as request to sync.", si->ssi_pid ); + log_debug("Received SIGRTMIN1 signal from PID %u, as request to sync.", si->ssi_pid); server_full_sync(s); return 0; diff --git a/src/journal/test-journal-interleaving.c b/src/journal/test-journal-interleaving.c index 801ebe7cf5..eeb67be019 100644 --- a/src/journal/test-journal-interleaving.c +++ b/src/journal/test-journal-interleaving.c @@ -20,7 +20,7 @@ static bool arg_keep = false; -_noreturn_ static void log_assert_errno(const char *text, int error, const char *file, int line, const char *func) { +_noreturn_ static void log_assert_errno(const char *text, int error, const char *file, unsigned line, const char *func) { log_internal(LOG_CRIT, error, file, line, func, "'%s' failed at %s:%u (%s): %m", text, file, line, func); abort(); diff --git a/src/journal/test-journal-verify.c b/src/journal/test-journal-verify.c index 1b30ebffaf..b971c79ea9 100644 --- a/src/journal/test-journal-verify.c +++ b/src/journal/test-journal-verify.c @@ -91,7 +91,7 @@ int main(int argc, char *argv[]) { dual_timestamp_get(&ts); - assert_se(asprintf(&test, "RANDOM=%lu", random() % RANDOM_RANGE)); + assert_se(asprintf(&test, "RANDOM=%li", random() % RANDOM_RANGE)); iovec = IOVEC_MAKE_STRING(test); diff --git a/src/libsystemd-network/dhcp-packet.c b/src/libsystemd-network/dhcp-packet.c index 1543d9adde..9748f8dd40 100644 --- a/src/libsystemd-network/dhcp-packet.c +++ b/src/libsystemd-network/dhcp-packet.c @@ -139,7 +139,7 @@ int dhcp_packet_verify_headers(DHCPPacket *packet, size_t len, bool checksum, ui if (packet->ip.ihl < 5) return log_debug_errno(SYNTHETIC_ERRNO(EINVAL), - "ignoring packet: IPv4 IHL (%u words) invalid", + "ignoring packet: IPv4 IHL (%i words) invalid", packet->ip.ihl); hdrlen = packet->ip.ihl * 4; diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c index 2611490067..606e48ce6f 100644 --- a/src/libsystemd-network/sd-dhcp6-client.c +++ b/src/libsystemd-network/sd-dhcp6-client.c @@ -207,7 +207,7 @@ static int dhcp6_client_set_duid_internal( if (r < 0) return log_dhcp6_client_errno(client, r, "Failed to validate length of DUID: %m"); - log_dhcp6_client(client, "Using DUID of type %u of incorrect length, proceeding.", duid_type); + log_dhcp6_client(client, "Using DUID of type %i of incorrect length, proceeding.", duid_type); } client->duid.type = htobe16(duid_type); diff --git a/src/libsystemd-network/test-ndisc-ra.c b/src/libsystemd-network/test-ndisc-ra.c index d4f8cf89b9..001df4d473 100644 --- a/src/libsystemd-network/test-ndisc-ra.c +++ b/src/libsystemd-network/test-ndisc-ra.c @@ -247,13 +247,13 @@ static int radv_recv(sd_event_source *s, int fd, uint32_t revents, void *userdat advertisement[7] = 0x00; } - printf ("Received Router Advertisement with lifetime %u\n", + printf ("Received Router Advertisement with lifetime %i\n", (advertisement[6] << 8) + advertisement[7]); /* test only up to buf size, rest is not yet implemented */ for (i = 0; i < sizeof(buf); i++) { if (!(i % 8)) - printf("%3zd: ", i); + printf("%3zu: ", i); printf("0x%02x", buf[i]); diff --git a/src/libsystemd/sd-event/test-event.c b/src/libsystemd/sd-event/test-event.c index cc3b84cf46..246658d024 100644 --- a/src/libsystemd/sd-event/test-event.c +++ b/src/libsystemd/sd-event/test-event.c @@ -655,7 +655,7 @@ TEST(ratelimit) { assert_se(sd_event_source_is_ratelimited(s) == 0); assert_se(count == 10); - log_info("ratelimit_io_handler: called %d times, event source not ratelimited", count); + log_info("ratelimit_io_handler: called %u times, event source not ratelimited", count); assert_se(sd_event_source_set_ratelimit(s, 0, 0) >= 0); assert_se(sd_event_source_set_ratelimit(s, 1 * USEC_PER_SEC, 5) >= 0); @@ -666,7 +666,7 @@ TEST(ratelimit) { assert_se(sd_event_run(e, UINT64_MAX) >= 0); assert_se(usleep(10) >= 0); } - log_info("ratelimit_io_handler: called %d times, event source got ratelimited", count); + log_info("ratelimit_io_handler: called %u times, event source got ratelimited", count); assert_se(count < 10); s = sd_event_source_unref(s); @@ -680,7 +680,7 @@ TEST(ratelimit) { assert_se(sd_event_run(e, UINT64_MAX) >= 0); } while (!sd_event_source_is_ratelimited(s)); - log_info("ratelimit_time_handler: called %d times, event source got ratelimited", count); + log_info("ratelimit_time_handler: called %u times, event source got ratelimited", count); assert_se(count == 10); /* In order to get rid of active rate limit client needs to disable it explicitly */ diff --git a/src/libsystemd/sd-netlink/test-netlink.c b/src/libsystemd/sd-netlink/test-netlink.c index 50e9d64663..3f74ecc068 100644 --- a/src/libsystemd/sd-netlink/test-netlink.c +++ b/src/libsystemd/sd-netlink/test-netlink.c @@ -499,7 +499,7 @@ static void test_get_addresses(sd_netlink *rtnl) { assert_se(ifindex > 0); assert_se(IN_SET(family, AF_INET, AF_INET6)); - log_info("got IPv%u address on ifindex %i", family == AF_INET ? 4: 6, ifindex); + log_info("got IPv%i address on ifindex %i", family == AF_INET ? 4 : 6, ifindex); } } diff --git a/src/libudev/test-libudev.c b/src/libudev/test-libudev.c index 354ded3a2b..b4526debf0 100644 --- a/src/libudev/test-libudev.c +++ b/src/libudev/test-libudev.c @@ -128,7 +128,7 @@ static void test_device_devnum(struct udev *udev) { dev_t devnum = makedev(1, 3); _cleanup_(udev_device_unrefp) struct udev_device *device; - log_info("/* %s, device %d:%d */", __func__, major(devnum), minor(devnum)); + log_info("/* %s, device %u:%u */", __func__, major(devnum), minor(devnum)); device = udev_device_new_from_devnum(udev, 'c', devnum); if (device) diff --git a/src/login/loginctl.c b/src/login/loginctl.c index b2c15aad81..b46ef2bb9d 100644 --- a/src/login/loginctl.c +++ b/src/login/loginctl.c @@ -478,9 +478,9 @@ static int print_session_status_info(sd_bus *bus, const char *path, bool *new_li printf("%s - ", strna(i.id)); if (i.name) - printf("%s (%"PRIu32")\n", i.name, i.uid); + printf("%s (" UID_FMT ")\n", i.name, i.uid); else - printf("%"PRIu32"\n", i.uid); + printf(UID_FMT "\n", i.uid); if (timestamp_is_set(i.timestamp.realtime)) printf("\t Since: %s; %s\n", @@ -490,7 +490,7 @@ static int print_session_status_info(sd_bus *bus, const char *path, bool *new_li if (i.leader > 0) { _cleanup_free_ char *t = NULL; - printf("\t Leader: %"PRIu32, i.leader); + printf("\t Leader: " PID_FMT, i.leader); (void) get_process_comm(i.leader, &t); if (t) diff --git a/src/login/logind.c b/src/login/logind.c index 3a6a6e0748..ebea23f01d 100644 --- a/src/login/logind.c +++ b/src/login/logind.c @@ -776,7 +776,7 @@ static int manager_connect_console(Manager *m) { if (SIGRTMIN + 1 > SIGRTMAX) return log_error_errno(SYNTHETIC_ERRNO(EINVAL), - "Not enough real-time signals available: %u-%u", + "Not enough real-time signals available: %i-%i", SIGRTMIN, SIGRTMAX); assert_se(ignore_signals(SIGRTMIN + 1) >= 0); diff --git a/src/login/pam_systemd.c b/src/login/pam_systemd.c index 98736856ee..ba8ee51ff6 100644 --- a/src/login/pam_systemd.c +++ b/src/login/pam_systemd.c @@ -278,7 +278,7 @@ static int get_seat_from_display(const char *display, const char **seat, uint32_ if (r < 0) return r; - if (asprintf(&sys_path, "/sys/dev/char/%d:%d", major(display_ctty), minor(display_ctty)) < 0) + if (asprintf(&sys_path, "/sys/dev/char/%u:%u", major(display_ctty), minor(display_ctty)) < 0) return -ENOMEM; r = readlink_value(sys_path, &tty); if (r < 0) diff --git a/src/network/netdev/macsec.c b/src/network/netdev/macsec.c index c0ddab212a..1e3f6a9c4b 100644 --- a/src/network/netdev/macsec.c +++ b/src/network/netdev/macsec.c @@ -841,7 +841,7 @@ int config_parse_macsec_key_id( } if (l > MACSEC_KEYID_LEN) { log_syntax(unit, LOG_WARNING, filename, line, 0, - "Specified KeyId= is larger then the allowed maximum (%zu > %u), ignoring: %s", + "Specified KeyId= is larger then the allowed maximum (%zu > %i), ignoring: %s", l, MACSEC_KEYID_LEN, rvalue); return 0; } diff --git a/src/network/networkctl.c b/src/network/networkctl.c index 3db2d26469..c489ccbf4e 100644 --- a/src/network/networkctl.c +++ b/src/network/networkctl.c @@ -135,7 +135,7 @@ static int dump_link_description(sd_bus *bus, char **patterns) { name = json_variant_string(json_variant_by_key(i, "Name")); index = json_variant_integer(json_variant_by_key(i, "Index")); - xsprintf(ifindex_str, "%ji", index); + xsprintf(ifindex_str, "%" PRIi64, index); if (!strv_fnmatch_full(patterns, ifindex_str, 0, &pos) && !strv_fnmatch_full(patterns, name, 0, &pos)) { diff --git a/src/network/networkd-can.c b/src/network/networkd-can.c index 205179d112..a3d5b68f6f 100644 --- a/src/network/networkd-can.c +++ b/src/network/networkd-can.c @@ -38,9 +38,9 @@ int can_set_netlink_message(Link *link, sd_netlink_message *m) { .sjw = link->network->can_sync_jump_width, }; - log_link_debug(link, "Setting bitrate = %d bit/s", bt.bitrate); + log_link_debug(link, "Setting bitrate = %u bit/s", bt.bitrate); if (link->network->can_sample_point > 0) - log_link_debug(link, "Setting sample point = %d.%d%%", bt.sample_point / 10, bt.sample_point % 10); + log_link_debug(link, "Setting sample point = %u.%u%%", bt.sample_point / 10, bt.sample_point % 10); else log_link_debug(link, "Using default sample point"); @@ -69,9 +69,9 @@ int can_set_netlink_message(Link *link, sd_netlink_message *m) { .sjw = link->network->can_data_sync_jump_width, }; - log_link_debug(link, "Setting data bitrate = %d bit/s", bt.bitrate); + log_link_debug(link, "Setting data bitrate = %u bit/s", bt.bitrate); if (link->network->can_data_sample_point > 0) - log_link_debug(link, "Setting data sample point = %d.%d%%", bt.sample_point / 10, bt.sample_point % 10); + log_link_debug(link, "Setting data sample point = %u.%u%%", bt.sample_point / 10, bt.sample_point % 10); else log_link_debug(link, "Using default data sample point"); diff --git a/src/network/networkd-dhcp-prefix-delegation.c b/src/network/networkd-dhcp-prefix-delegation.c index 5c883ba37d..ee5e521e75 100644 --- a/src/network/networkd-dhcp-prefix-delegation.c +++ b/src/network/networkd-dhcp-prefix-delegation.c @@ -477,7 +477,7 @@ static int dhcp_pd_get_preferred_subnet_prefix( r = dhcp_pd_calculate_subnet_prefix(pd_prefix, pd_prefix_len, link->network->dhcp_pd_subnet_id, &prefix); if (r < 0) return log_link_warning_errno(link, r, - "subnet id %" PRIu64 " is out of range. Only have %" PRIu64 " subnets.", + "subnet id %" PRIi64 " is out of range. Only have %" PRIu64 " subnets.", link->network->dhcp_pd_subnet_id, UINT64_C(1) << (64 - pd_prefix_len)); *ret = prefix; diff --git a/src/network/networkd-ndisc.c b/src/network/networkd-ndisc.c index 12168a20fb..8e6e787536 100644 --- a/src/network/networkd-ndisc.c +++ b/src/network/networkd-ndisc.c @@ -711,7 +711,7 @@ static int ndisc_router_process_rdnss(Link *link, sd_ndisc_router *rt) { return log_link_error_errno(link, n, "Failed to get RDNSS addresses: %m"); if (n >= (int) NDISC_RDNSS_MAX) { - log_link_warning(link, "Too many RDNSS records per link. Only first %i records will be used.", NDISC_RDNSS_MAX); + log_link_warning(link, "Too many RDNSS records per link. Only first %u records will be used.", NDISC_RDNSS_MAX); n = NDISC_RDNSS_MAX; } @@ -805,7 +805,7 @@ static int ndisc_router_process_dnssl(Link *link, sd_ndisc_router *rt) { return log_link_error_errno(link, r, "Failed to get DNSSL addresses: %m"); if (strv_length(l) >= NDISC_DNSSL_MAX) { - log_link_warning(link, "Too many DNSSL records per link. Only first %i records will be used.", NDISC_DNSSL_MAX); + log_link_warning(link, "Too many DNSSL records per link. Only first %u records will be used.", NDISC_DNSSL_MAX); STRV_FOREACH(j, l + NDISC_DNSSL_MAX) *j = mfree(*j); } diff --git a/src/network/networkd-nexthop.c b/src/network/networkd-nexthop.c index a3b50cefe1..d82766702a 100644 --- a/src/network/networkd-nexthop.c +++ b/src/network/networkd-nexthop.c @@ -361,7 +361,7 @@ static void log_nexthop_debug(const NextHop *nexthop, const char *str, const Lin (void) route_flags_to_string_alloc(nexthop->flags, &flags); HASHMAP_FOREACH(nhg, nexthop->group) - (void) strextendf_with_separator(&group, ",", "%"PRIu32":%"PRIu32, nhg->id, nhg->weight+1); + (void) strextendf_with_separator(&group, ",", "%"PRIu32":%"PRIu32, nhg->id, nhg->weight+1u); log_link_debug(link, "%s %s nexthop (%s): id: %"PRIu32", gw: %s, blackhole: %s, group: %s, flags: %s", str, strna(network_config_source_to_string(nexthop->source)), strna(state), diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c index 4f097364a1..3c84d80e4d 100644 --- a/src/network/networkd-route.c +++ b/src/network/networkd-route.c @@ -592,7 +592,7 @@ static void log_route_debug(const Route *route, const char *str, const Link *lin if (m->ifname) (void) strextend(&gw_alloc, "@", m->ifname); else if (m->ifindex > 0) - (void) strextendf(&gw_alloc, "@%"PRIu32, m->ifindex); + (void) strextendf(&gw_alloc, "@%i", m->ifindex); /* See comments in config_parse_multipath_route(). */ (void) strextendf(&gw_alloc, ":%"PRIu32, m->weight + 1); } @@ -1706,7 +1706,7 @@ int manager_rtnl_process_route(sd_netlink *rtnl, sd_netlink_message *message, Ma return 0; } else if (r >= 0) { if (ifindex <= 0) { - log_warning("rtnl: received route message with invalid ifindex %d, ignoring.", ifindex); + log_warning("rtnl: received route message with invalid ifindex %u, ignoring.", ifindex); return 0; } @@ -1715,7 +1715,7 @@ int manager_rtnl_process_route(sd_netlink *rtnl, sd_netlink_message *message, Ma /* when enumerating we might be out of sync, but we will * get the route again, so just ignore it */ if (!m->enumerating) - log_warning("rtnl: received route message for link (%d) we do not know about, ignoring", ifindex); + log_warning("rtnl: received route message for link (%u) we do not know about, ignoring", ifindex); return 0; } } diff --git a/src/nspawn/nspawn-oci.c b/src/nspawn/nspawn-oci.c index 40d3b31700..a9a1cd33d9 100644 --- a/src/nspawn/nspawn-oci.c +++ b/src/nspawn/nspawn-oci.c @@ -354,7 +354,7 @@ static int oci_oom_score_adj(const char *name, JsonVariant *v, JsonDispatchFlags k = json_variant_integer(v); if (k < OOM_SCORE_ADJ_MIN || k > OOM_SCORE_ADJ_MAX) return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), - "oomScoreAdj value out of range: %ji", k); + "oomScoreAdj value out of range: %" PRIi64, k); s->oom_score_adjust = (int) k; s->oom_score_adjust_set = true; @@ -373,7 +373,7 @@ static int oci_uid_gid(const char *name, JsonVariant *v, JsonDispatchFlags flags u = (uid_t) k; if ((uint64_t) u != k) return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), - "UID/GID out of range: %ji", k); + "UID/GID out of range: %" PRIu64, k); if (!uid_is_valid(u)) return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), @@ -712,7 +712,7 @@ static int oci_uid_gid_range(const char *name, JsonVariant *v, JsonDispatchFlags u = (uid_t) k; if ((uint64_t) u != k) return json_log(v, flags, SYNTHETIC_ERRNO(ERANGE), - "UID/GID out of range: %ji", k); + "UID/GID out of range: %" PRIu64, k); if (u == 0) return json_log(v, flags, SYNTHETIC_ERRNO(ERANGE), "UID/GID range can't be zero."); @@ -811,7 +811,7 @@ static int oci_device_major(const char *name, JsonVariant *v, JsonDispatchFlags k = json_variant_unsigned(v); if (!DEVICE_MAJOR_VALID(k)) return json_log(v, flags, SYNTHETIC_ERRNO(ERANGE), - "Device major %ji out of range.", k); + "Device major %" PRIu64 " out of range.", k); *u = (unsigned) k; return 0; @@ -826,7 +826,7 @@ static int oci_device_minor(const char *name, JsonVariant *v, JsonDispatchFlags k = json_variant_unsigned(v); if (!DEVICE_MINOR_VALID(k)) return json_log(v, flags, SYNTHETIC_ERRNO(ERANGE), - "Device minor %ji out of range.", k); + "Device minor %" PRIu64 " out of range.", k); *u = (unsigned) k; return 0; @@ -1192,7 +1192,7 @@ static int oci_cgroup_memory_limit(const char *name, JsonVariant *v, JsonDispatc k = json_variant_unsigned(v); if (k >= UINT64_MAX) return json_log(v, flags, SYNTHETIC_ERRNO(ERANGE), - "Memory limit too large: %ji", k); + "Memory limit too large: %" PRIu64, k); *m = (uint64_t) k; return 0; diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index f90207c508..75af4c58f9 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -4934,7 +4934,7 @@ static int run_container( if (l < 0) return log_error_errno(errno, "Failed to read cgroup mode: %m"); if (l != sizeof(arg_unified_cgroup_hierarchy)) - return log_error_errno(SYNTHETIC_ERRNO(EIO), "Short read while reading cgroup mode (%zu bytes).%s", + return log_error_errno(SYNTHETIC_ERRNO(EIO), "Short read while reading cgroup mode (%zi bytes).%s", l, l == 0 ? " The child is most likely dead." : ""); } diff --git a/src/resolve/resolved-dns-rr.c b/src/resolve/resolved-dns-rr.c index 92245770bc..a5ca0e9c6a 100644 --- a/src/resolve/resolved-dns-rr.c +++ b/src/resolve/resolved-dns-rr.c @@ -325,8 +325,8 @@ char* dns_resource_key_to_string(const DnsResourceKey *key, char *buf, size_t bu (void) snprintf(buf, buf_size, "%s %s%s%.0u %s%s%.0u", dns_resource_key_name(key), - strempty(c), c ? "" : "CLASS", c ? 0 : key->class, - strempty(t), t ? "" : "TYPE", t ? 0 : key->type); + strempty(c), c ? "" : "CLASS", c ? 0u : key->class, + strempty(t), t ? "" : "TYPE", t ? 0u : key->type); return ans; } diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c index 0525a3b96e..86acd7ef8c 100644 --- a/src/resolve/resolved-manager.c +++ b/src/resolve/resolved-manager.c @@ -870,7 +870,7 @@ int manager_recv(Manager *m, int fd, DnsProtocol protocol, DnsPacket **ret) { p->ifindex = manager_find_ifindex(m, p->family, &p->destination); } - log_debug("Received %s UDP packet of size %zu, ifindex=%i, ttl=%i, fragsize=%zu, sender=%s, destination=%s", + log_debug("Received %s UDP packet of size %zu, ifindex=%i, ttl=%u, fragsize=%zu, sender=%s, destination=%s", dns_protocol_to_string(protocol), p->size, p->ifindex, p->ttl, p->fragsize, IN_ADDR_TO_STRING(p->family, &p->sender), IN_ADDR_TO_STRING(p->family, &p->destination)); diff --git a/src/rfkill/rfkill.c b/src/rfkill/rfkill.c index a833771d97..8aec9b21e4 100644 --- a/src/rfkill/rfkill.c +++ b/src/rfkill/rfkill.c @@ -75,7 +75,7 @@ static int find_device( assert(event); assert(ret); - if (asprintf(&sysname, "rfkill%i", event->idx) < 0) + if (asprintf(&sysname, "rfkill%u", event->idx) < 0) return log_oom(); r = sd_device_new_from_subsystem_sysname(&device, "rfkill", sysname); @@ -176,7 +176,7 @@ static int load_state(Context *c, const struct rfkill_event *event) { ssize_t l = write(c->rfkill_fd, &we, sizeof we); if (l < 0) - return log_error_errno(errno, "Failed to restore rfkill state for %i: %m", event->idx); + return log_error_errno(errno, "Failed to restore rfkill state for %u: %m", event->idx); if ((size_t)l < RFKILL_EVENT_SIZE_V1) /* l cannot be < 0 here. Cast to fix -Werror=sign-compare */ return log_error_errno(SYNTHETIC_ERRNO(EIO), "Couldn't write rfkill event structure, too short (wrote %zd of %zu bytes).", @@ -347,29 +347,29 @@ static int run(int argc, char *argv[]) { const char *type = rfkill_type_to_string(event.type); if (!type) { - log_debug("An rfkill device of unknown type %i discovered, ignoring.", event.type); + log_debug("An rfkill device of unknown type %u discovered, ignoring.", event.type); continue; } switch (event.op) { case RFKILL_OP_ADD: - log_debug("A new rfkill device has been added with index %i and type %s.", event.idx, type); + log_debug("A new rfkill device has been added with index %u and type %s.", event.idx, type); (void) load_state(&c, &event); break; case RFKILL_OP_DEL: - log_debug("An rfkill device has been removed with index %i and type %s", event.idx, type); + log_debug("An rfkill device has been removed with index %u and type %s", event.idx, type); (void) save_state_cancel(&c, &event); break; case RFKILL_OP_CHANGE: - log_debug("An rfkill device has changed state with index %i and type %s", event.idx, type); + log_debug("An rfkill device has changed state with index %u and type %s", event.idx, type); (void) save_state_queue(&c, &event); break; default: - log_debug("Unknown event %i from /dev/rfkill for index %i and type %s, ignoring.", event.op, event.idx, type); + log_debug("Unknown event %u from /dev/rfkill for index %u and type %s, ignoring.", event.op, event.idx, type); break; } } diff --git a/src/run/run.c b/src/run/run.c index 4cb4478cf8..32c001fabc 100644 --- a/src/run/run.c +++ b/src/run/run.c @@ -1318,7 +1318,7 @@ static int start_transient_service( log_info("Finished with result: %s", strna(c.result)); if (c.exit_code == CLD_EXITED) - log_info("Main processes terminated with: code=%s/status=%i", + log_info("Main processes terminated with: code=%s/status=%u", sigchld_code_to_string(c.exit_code), c.exit_status); else if (c.exit_code > 0) log_info("Main processes terminated with: code=%s/status=%s", diff --git a/src/shared/bus-unit-procs.c b/src/shared/bus-unit-procs.c index 56d522a7d0..8b462b5627 100644 --- a/src/shared/bus-unit-procs.c +++ b/src/shared/bus-unit-procs.c @@ -378,7 +378,7 @@ int unit_show_processes( if (r == -ENOMEM) goto finish; if (r < 0) - log_warning_errno(r, "Invalid process description in GetUnitProcesses reply: cgroup=\"%s\" pid="PID_FMT" command=\"%s\", ignoring: %m", + log_warning_errno(r, "Invalid process description in GetUnitProcesses reply: cgroup=\"%s\" pid=%u command=\"%s\", ignoring: %m", path, pid, name); } diff --git a/src/shared/cpu-set-util.c b/src/shared/cpu-set-util.c index e3e69635a6..7edb673d97 100644 --- a/src/shared/cpu-set-util.c +++ b/src/shared/cpu-set-util.c @@ -62,9 +62,9 @@ char *cpu_set_to_range_string(const CPUSet *set) { return NULL; if (range_end > range_start) - r = sprintf(str + len, len > 0 ? " %d-%d" : "%d-%d", range_start, range_end); + r = sprintf(str + len, len > 0 ? " %u-%u" : "%u-%u", range_start, range_end); else - r = sprintf(str + len, len > 0 ? " %d" : "%d", range_start); + r = sprintf(str + len, len > 0 ? " %u" : "%u", range_start); assert_se(r > 0); len += r; } @@ -74,9 +74,9 @@ char *cpu_set_to_range_string(const CPUSet *set) { return NULL; if (range_end > range_start) - r = sprintf(str + len, len > 0 ? " %d-%d" : "%d-%d", range_start, range_end); + r = sprintf(str + len, len > 0 ? " %u-%u" : "%u-%u", range_start, range_end); else - r = sprintf(str + len, len > 0 ? " %d" : "%d", range_start); + r = sprintf(str + len, len > 0 ? " %u" : "%u", range_start); assert_se(r > 0); } diff --git a/src/shared/json.c b/src/shared/json.c index 67b6b75fa8..919f7f79db 100644 --- a/src/shared/json.c +++ b/src/shared/json.c @@ -904,7 +904,7 @@ int64_t json_variant_integer(JsonVariant *v) { if (v->value.unsig <= INT64_MAX) return (int64_t) v->value.unsig; - log_debug("Unsigned integer %ju requested as signed integer and out of range, returning 0.", v->value.unsig); + log_debug("Unsigned integer %" PRIu64 " requested as signed integer and out of range, returning 0.", v->value.unsig); return 0; case JSON_VARIANT_REAL: { @@ -946,7 +946,7 @@ uint64_t json_variant_unsigned(JsonVariant *v) { if (v->value.integer >= 0) return (uint64_t) v->value.integer; - log_debug("Signed integer %ju requested as unsigned integer and out of range, returning 0.", v->value.integer); + log_debug("Signed integer %" PRIi64 " requested as unsigned integer and out of range, returning 0.", v->value.integer); return 0; case JSON_VARIANT_UNSIGNED: @@ -996,7 +996,7 @@ double json_variant_real(JsonVariant *v) { if ((int64_t) converted == v->value.integer) return converted; - log_debug("Signed integer %ji requested as real, and cannot be converted losslessly, returning 0.", v->value.integer); + log_debug("Signed integer %" PRIi64 " requested as real, and cannot be converted losslessly, returning 0.", v->value.integer); return 0.0; } @@ -1006,7 +1006,7 @@ double json_variant_real(JsonVariant *v) { if ((uint64_t) converted == v->value.unsig) return converted; - log_debug("Unsigned integer %ju requested as real, and cannot be converted losslessly, returning 0.", v->value.unsig); + log_debug("Unsigned integer %" PRIu64 " requested as real, and cannot be converted losslessly, returning 0.", v->value.unsig); return 0.0; } diff --git a/src/shared/mount-util.c b/src/shared/mount-util.c index a119a7c3c1..290bbec4df 100644 --- a/src/shared/mount-util.c +++ b/src/shared/mount-util.c @@ -1060,7 +1060,7 @@ static int make_userns(uid_t uid_shift, uid_t uid_range, RemountIdmapFlags flags /* Allocates a userns file descriptor with the mapping we need. For this we'll fork off a child * process whose only purpose is to give us a new user namespace. It's killed when we got it. */ - if (asprintf(&line, UID_FMT " " UID_FMT " " UID_FMT "\n", 0, uid_shift, uid_range) < 0) + if (asprintf(&line, UID_FMT " " UID_FMT " " UID_FMT "\n", 0u, uid_shift, uid_range) < 0) return log_oom_debug(); /* If requested we'll include an entry in the mapping so that the host root user can make changes to @@ -1076,7 +1076,7 @@ static int make_userns(uid_t uid_shift, uid_t uid_range, RemountIdmapFlags flags if (flags & REMOUNT_IDMAP_HOST_ROOT) if (strextendf(&line, UID_FMT " " UID_FMT " " UID_FMT "\n", - UID_MAPPED_ROOT, 0, 1) < 0) + UID_MAPPED_ROOT, 0u, 1u) < 0) return log_oom_debug(); /* We always assign the same UID and GID ranges */ diff --git a/src/shared/netif-sriov.c b/src/shared/netif-sriov.c index 9edc174124..18e5f0eeb7 100644 --- a/src/shared/netif-sriov.c +++ b/src/shared/netif-sriov.c @@ -395,13 +395,13 @@ int config_parse_sr_iov_uint32( if (streq(lvalue, "VLANId")) { if (k == 0 || k > 4095) { - log_syntax(unit, LOG_WARNING, filename, line, 0, "Invalid SR-IOV VLANId: %d", k); + log_syntax(unit, LOG_WARNING, filename, line, 0, "Invalid SR-IOV VLANId: %u", k); return 0; } sr_iov->vlan = k; } else if (streq(lvalue, "VirtualFunction")) { if (k >= INT_MAX) { - log_syntax(unit, LOG_WARNING, filename, line, 0, "Invalid SR-IOV virtual function: %d", k); + log_syntax(unit, LOG_WARNING, filename, line, 0, "Invalid SR-IOV virtual function: %u", k); return 0; } sr_iov->vf = k; diff --git a/src/shared/watchdog.c b/src/shared/watchdog.c index 2476778c94..48186134aa 100644 --- a/src/shared/watchdog.c +++ b/src/shared/watchdog.c @@ -52,7 +52,7 @@ static int get_watchdog_sysfs_path(const char *filename, char **ret_path) { if (!S_ISCHR(st.st_mode)) return -EBADF; - if (asprintf(ret_path, "/sys/dev/char/%d:%d/%s", major(st.st_rdev), minor(st.st_rdev), filename) < 0) + if (asprintf(ret_path, "/sys/dev/char/%u:%u/%s", major(st.st_rdev), minor(st.st_rdev), filename) < 0) return -ENOMEM; return 0; diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c index 14f5ac3246..93c32d8eeb 100644 --- a/src/sysusers/sysusers.c +++ b/src/sysusers/sysusers.c @@ -1256,7 +1256,7 @@ static int add_group(Item *i) { */ if (r > 0) return log_error_errno(SYNTHETIC_ERRNO(EINVAL), - "Failed to create %s: please create GID %d", + "Failed to create %s: please create GID " GID_FMT, i->name, i->gid); if (r == 0) return 0; diff --git a/src/test/test-conf-parser.c b/src/test/test-conf-parser.c index e61932ab16..8c27dcac3f 100644 --- a/src/test/test-conf-parser.c +++ b/src/test/test-conf-parser.c @@ -322,7 +322,7 @@ static void test_config_parse_one(unsigned i, const char *s) { {} }; - log_info("== %s[%i] ==", __func__, i); + log_info("== %s[%u] ==", __func__, i); assert_se(fmkostemp_safe(name, "r+", &f) == 0); assert_se(fwrite(s, strlen(s), 1, f) == 1); diff --git a/src/test/test-dns-domain.c b/src/test/test-dns-domain.c index 0fbac9dbd9..6c107e2f65 100644 --- a/src/test/test-dns-domain.c +++ b/src/test/test-dns-domain.c @@ -567,7 +567,7 @@ TEST(dns_name_change_suffix) { static void test_dns_name_suffix_one(const char *name, unsigned n_labels, const char *result, int ret) { const char *p = NULL; - log_info("%s, %d, →%s, %d", name, n_labels, strnull(result), ret); + log_info("%s, %u, → %s, %d", name, n_labels, strnull(result), ret); assert_se(ret == dns_name_suffix(name, n_labels, &p)); assert_se(streq_ptr(p, result)); diff --git a/src/test/test-escape.c b/src/test/test-escape.c index 214190e134..da19272624 100644 --- a/src/test/test-escape.c +++ b/src/test/test-escape.c @@ -33,7 +33,7 @@ static void test_xescape_full_one(bool eight_bits) { assert_se(t = xescape_full("abc\\\"\b\f\n\r\t\v\a\003\177\234\313", "b", i, flags)); - log_info("%02d: <%s>", i, t); + log_info("%02u: <%s>", i, t); if (i >= full_fit) assert_se(streq(t, escaped)); @@ -51,7 +51,7 @@ static void test_xescape_full_one(bool eight_bits) { assert_se(q = xescape_full("abc\\\"\b\f\n\r\t\v\a\003\177\234\313", "b", i, flags | XESCAPE_FORCE_ELLIPSIS)); - log_info("%02d: <%s>", i, q); + log_info("%02u: <%s>", i, q); if (i > 0) assert_se(endswith(q, ".")); assert_se(strlen(q) <= i); diff --git a/src/test/test-sleep.c b/src/test/test-sleep.c index 5aebcdd935..6bac115f71 100644 --- a/src/test/test-sleep.c +++ b/src/test/test-sleep.c @@ -30,10 +30,10 @@ TEST(parse_sleep_config) { his = strv_join(sleep_config->states[SLEEP_HIBERNATE], ", "); hym = strv_join(sleep_config->modes[SLEEP_HYBRID_SLEEP], ", "); hys = strv_join(sleep_config->states[SLEEP_HYBRID_SLEEP], ", "); - log_debug(" allow_suspend: %u", sleep_config->allow[SLEEP_SUSPEND]); - log_debug(" allow_hibernate: %u", sleep_config->allow[SLEEP_HIBERNATE]); - log_debug(" allow_s2h: %u", sleep_config->allow[SLEEP_SUSPEND_THEN_HIBERNATE]); - log_debug(" allow_hybrid_sleep: %u", sleep_config->allow[SLEEP_HYBRID_SLEEP]); + log_debug(" allow_suspend: %s", yes_no(sleep_config->allow[SLEEP_SUSPEND])); + log_debug(" allow_hibernate: %s", yes_no(sleep_config->allow[SLEEP_HIBERNATE])); + log_debug(" allow_s2h: %s", yes_no(sleep_config->allow[SLEEP_SUSPEND_THEN_HIBERNATE])); + log_debug(" allow_hybrid_sleep: %s", yes_no(sleep_config->allow[SLEEP_HYBRID_SLEEP])); log_debug(" suspend modes: %s", sum); log_debug(" states: %s", sus); log_debug(" hibernate modes: %s", him); diff --git a/src/test/test-string-util.c b/src/test/test-string-util.c index 1a753b836a..f5d7ab12b5 100644 --- a/src/test/test-string-util.c +++ b/src/test/test-string-util.c @@ -34,7 +34,7 @@ TEST(string_erase) { } static void test_free_and_strndup_one(char **t, const char *src, size_t l, const char *expected, bool change) { - log_debug("%s: \"%s\", \"%s\", %zd (expect \"%s\", %s)", + log_debug("%s: \"%s\", \"%s\", %zu (expect \"%s\", %s)", __func__, strnull(*t), strnull(src), l, strnull(expected), yes_no(change)); int r = free_and_strndup(t, src, l); diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c index 9325523838..2de24cf0b7 100644 --- a/src/timesync/timesyncd-manager.c +++ b/src/timesync/timesyncd-manager.c @@ -536,11 +536,11 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re manager_adjust_poll(m, offset, spike); log_debug("NTP response:\n" - " leap : %u\n" - " version : %u\n" - " mode : %u\n" + " leap : %i\n" + " version : %i\n" + " mode : %i\n" " stratum : %u\n" - " precision : %.6f sec (%d)\n" + " precision : %.6f sec (%i)\n" " root distance: %.6f sec\n" " reference : %.4s\n" " origin : %.3f\n" diff --git a/src/udev/dmi_memory_id/dmi_memory_id.c b/src/udev/dmi_memory_id/dmi_memory_id.c index 338cbc72c0..1345289219 100644 --- a/src/udev/dmi_memory_id/dmi_memory_id.c +++ b/src/udev/dmi_memory_id/dmi_memory_id.c @@ -117,7 +117,7 @@ static void dmi_print_memory_size( code <<= 10; if (slot_num >= 0) - printf("%s_%u_%s=%"PRIu64"\n", attr_prefix, slot_num, attr_suffix, code); + printf("%s_%i_%s=%"PRIu64"\n", attr_prefix, slot_num, attr_suffix, code); else printf("%s_%s=%"PRIu64"\n", attr_prefix, attr_suffix, code); } diff --git a/src/udev/scsi_id/scsi_serial.c b/src/udev/scsi_id/scsi_serial.c index 992d1cf25b..299ccb96fb 100644 --- a/src/udev/scsi_id/scsi_serial.c +++ b/src/udev/scsi_id/scsi_serial.c @@ -284,7 +284,7 @@ static int scsi_inquiry(struct scsi_id_device *dev_scsi, int fd, if (buflen > SCSI_INQ_BUFF_LEN) return log_debug_errno(SYNTHETIC_ERRNO(EINVAL), - "buflen %d too long", buflen); + "buflen %u too long", buflen); resend: if (dev_scsi->use_sg == 4) { @@ -764,7 +764,7 @@ int scsi_std_inquiry(struct scsi_id_device *dev_scsi, const char *devname) { err = 2; goto out; } - sprintf(dev_scsi->kernel,"%d:%d", major(statbuf.st_rdev), + sprintf(dev_scsi->kernel,"%u:%u", major(statbuf.st_rdev), minor(statbuf.st_rdev)); memzero(buf, SCSI_INQ_BUFF_LEN); diff --git a/src/udev/udev-builtin-input_id.c b/src/udev/udev-builtin-input_id.c index f04e29b8f8..6da8ad85bb 100644 --- a/src/udev/udev-builtin-input_id.c +++ b/src/udev/udev-builtin-input_id.c @@ -288,7 +288,7 @@ static bool test_pointers(sd_device *dev, num_well_known_keys++; if (num_well_known_keys >= 4 || num_joystick_buttons + num_joystick_axes < 2) { - log_device_debug(dev, "Input device has %zd joystick buttons and %zd axes but also %zd keyboard key sets, " + log_device_debug(dev, "Input device has %zu joystick buttons and %zu axes but also %zu keyboard key sets, " "assuming this is a keyboard, not a joystick.", num_joystick_buttons, num_joystick_axes, num_well_known_keys); is_joystick = false; diff --git a/src/udev/udev-builtin-keyboard.c b/src/udev/udev-builtin-keyboard.c index b09757bfc2..6dd9eebd93 100644 --- a/src/udev/udev-builtin-keyboard.c +++ b/src/udev/udev-builtin-keyboard.c @@ -78,11 +78,11 @@ static int map_keycode(sd_device *dev, int fd, int scancode, const char *keycode map.scan = scancode; map.key = keycode_num; - log_device_debug(dev, "keyboard: mapping scan code %d (0x%x) to key code %d (0x%x)", + log_device_debug(dev, "keyboard: mapping scan code %u (0x%x) to key code %u (0x%x)", map.scan, map.scan, map.key, map.key); if (ioctl(fd, EVIOCSKEYCODE, &map) < 0) - return log_device_error_errno(dev, errno, "Failed to call EVIOCSKEYCODE with scan code 0x%x, and key code %d: %m", map.scan, map.key); + return log_device_error_errno(dev, errno, "Failed to call EVIOCSKEYCODE with scan code 0x%x, and key code %u: %m", map.scan, map.key); return 0; } diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c index 33fce6e140..4749cb4cf2 100644 --- a/src/udev/udev-builtin-net_id.c +++ b/src/udev/udev-builtin-net_id.c @@ -938,7 +938,7 @@ static int names_mac(sd_device *dev, const LinkInfo *info) { return log_device_debug_errno(dev, r, "Failed to parse addr_assign_type: %m"); if (i != NET_ADDR_PERM) return log_device_debug_errno(dev, SYNTHETIC_ERRNO(EINVAL), - "addr_assign_type=%d, MAC address is not permanent.", i); + "addr_assign_type=%u, MAC address is not permanent.", i); return 0; } diff --git a/src/udev/udev-builtin-path_id.c b/src/udev/udev-builtin-path_id.c index d33eede984..ce7bc5caf0 100644 --- a/src/udev/udev-builtin-path_id.c +++ b/src/udev/udev-builtin-path_id.c @@ -374,7 +374,7 @@ static sd_device *handle_scsi_default(sd_device *parent, char **path) { return hostdev; host -= basenum; - path_prepend(path, "scsi-%u:%u:%u:%u", host, bus, target, lun); + path_prepend(path, "scsi-%i:%i:%i:%i", host, bus, target, lun); return hostdev; } diff --git a/src/udev/udev-builtin-usb_id.c b/src/udev/udev-builtin-usb_id.c index d37469c62b..eb32661255 100644 --- a/src/udev/udev-builtin-usb_id.c +++ b/src/udev/udev-builtin-usb_id.c @@ -292,7 +292,7 @@ static int builtin_usb_id(sd_device *dev, sd_netlink **rtnl, int argc, char *arg } else set_usb_iftype(type_str, if_class_num, sizeof(type_str)-1); - log_device_debug(dev_interface, "if_class:%d protocol:%d", if_class_num, protocol); + log_device_debug(dev_interface, "if_class:%u protocol:%i", if_class_num, protocol); /* usb device directory */ r = sd_device_get_parent_with_subsystem_devtype(dev_interface, "usb", "usb_device", &dev_usb); diff --git a/src/xdg-autostart-generator/test-xdg-autostart.c b/src/xdg-autostart-generator/test-xdg-autostart.c index a357cf50fe..e18c918daa 100644 --- a/src/xdg-autostart-generator/test-xdg-autostart.c +++ b/src/xdg-autostart-generator/test-xdg-autostart.c @@ -55,7 +55,7 @@ static void test_xdg_desktop_parse_one(unsigned i, const char *s) { _cleanup_fclose_ FILE *f = NULL; _cleanup_(xdg_autostart_service_freep) XdgAutostartService *service = NULL; - log_info("== %s[%i] ==", __func__, i); + log_info("== %s[%u] ==", __func__, i); assert_se(fmkostemp_safe(name, "r+", &f) == 0); assert_se(fwrite(s, strlen(s), 1, f) == 1); |