From 97f975a97d62fe9fab8de5103f58b1509633609c Mon Sep 17 00:00:00 2001 From: kylin-bot Date: Mon, 1 Jun 2026 19:10:43 +0800 Subject: [PATCH] apply patch 5341 --- src/rfkill.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/rfkill.c b/src/rfkill.c index a0a50d9..f2a2eea 100644 --- a/src/rfkill.c +++ b/src/rfkill.c @@ -93,14 +93,18 @@ int rfkill_get_blocked(uint16_t index) return -1; } + fcntl(fd, F_SETFL, O_NONBLOCK); // 设置非阻塞模式 + while (1) { struct rfkill_event event = { 0 }; int id; ssize_t len; len = read(fd, &event, sizeof(event)); - if (len < RFKILL_EVENT_SIZE_V1) + if (len < 0) { + info("Failed to read rfkill event, index %u: %s", index, strerror(errno)); break; + } id = get_adapter_id_for_rfkill(event.idx); -- Gitee