gcc will complain about all these with -Wformat-signedness.
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;
}
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
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;
}
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;
}
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)
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;
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;
}
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;
}
}
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");
}
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();
/* 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();
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);
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;
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;
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;
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();
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);
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;
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);
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]);
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);
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);
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 */
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);
}
}
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)
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",
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)
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);
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)
}
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;
}
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)) {
.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");
.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");
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;
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;
}
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);
}
(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),
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);
}
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;
}
/* 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;
}
}
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;
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),
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.");
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;
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;
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;
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." : "");
}
(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;
}
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));
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);
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).",
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;
}
}
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",
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);
}
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;
}
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);
}
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: {
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:
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;
}
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;
}
/* 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
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 */
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;
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;
*/
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;
{}
};
- 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);
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));
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));
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);
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);
}
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);
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"
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);
}
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) {
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);
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;
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;
}
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;
}
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;
}
} 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);
_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);