summaryrefslogtreecommitdiff
path: root/src/rfkill
diff options
context:
space:
mode:
authorJan Janssen <medhefgo@web.de>2022-08-29 13:07:11 +0200
committerJan Janssen <medhefgo@web.de>2022-08-30 12:03:28 +0200
commitc0f86d66f3f6b561528e7f856f9926bec766c036 (patch)
treeb5b17ffb3a41a7974ff0ad35db009b4f8aa94116 /src/rfkill
parent125d108665506e8abfd575f2cbf7adf9d0ae0a00 (diff)
downloadsystemd-c0f86d66f3f6b561528e7f856f9926bec766c036.tar.gz
tree-wide: Use correct format specifiers
gcc will complain about all these with -Wformat-signedness.
Diffstat (limited to 'src/rfkill')
-rw-r--r--src/rfkill/rfkill.c14
1 files changed, 7 insertions, 7 deletions
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;
}
}