systemd/0005-Revert-rfkill-don-t-compare-values-of-different-sign.patch
Lukas Nykryn 1cc7dd62a1 systemd-248-5
Resolves: #1931710
2021-05-17 07:59:40 +02:00

35 lines
1.6 KiB
Diff

From 0f0bf5f2adef31405a51a470d1ce268390cf403c Mon Sep 17 00:00:00 2001
From: Frantisek Sumsal <fsumsal@redhat.com>
Date: Fri, 14 May 2021 16:25:52 +0200
Subject: [PATCH] Revert "rfkill: don't compare values of different signedness"
This reverts commit 01095757986d9c93151cab01bb39d888c2094a78.
Resolves: #1931710
---
src/rfkill/rfkill.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/rfkill/rfkill.c b/src/rfkill/rfkill.c
index 6126e9b0c4..e2d1a1be5f 100644
--- a/src/rfkill/rfkill.c
+++ b/src/rfkill/rfkill.c
@@ -177,7 +177,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);
- if ((size_t) l < RFKILL_EVENT_SIZE_V1)
+ if (l < RFKILL_EVENT_SIZE_V1)
return log_error_errno(SYNTHETIC_ERRNO(EIO),
"Couldn't write rfkill event structure, too short (wrote %zd of %zu bytes).",
l, sizeof we);
@@ -335,7 +335,7 @@ static int run(int argc, char *argv[]) {
break;
}
- if ((size_t) l < RFKILL_EVENT_SIZE_V1)
+ if (l < RFKILL_EVENT_SIZE_V1)
return log_error_errno(SYNTHETIC_ERRNO(EIO), "Short read of struct rfkill_event: (%zd < %d)",
l, RFKILL_EVENT_SIZE_V1);
log_debug("Reading struct rfkill_event: got %zd bytes.", l);