fix(rfkill): handle EAGAIN correctly
This commit is contained in:
parent
6d5afdaa5f
commit
e786ea601e
|
@ -56,14 +56,15 @@ bool waybar::util::Rfkill::on_event(Glib::IOCondition cond) {
|
||||||
|
|
||||||
len = read(fd_, &event, sizeof(event));
|
len = read(fd_, &event, sizeof(event));
|
||||||
if (len < 0) {
|
if (len < 0) {
|
||||||
|
if (errno == EAGAIN) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
spdlog::error("Reading of RFKILL events failed: {}", errno);
|
spdlog::error("Reading of RFKILL events failed: {}", errno);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (len < RFKILL_EVENT_SIZE_V1) {
|
if (len < RFKILL_EVENT_SIZE_V1) {
|
||||||
if (errno != EAGAIN) {
|
spdlog::error("Wrong size of RFKILL event: {} < {}", len, RFKILL_EVENT_SIZE_V1);
|
||||||
spdlog::error("Wrong size of RFKILL event: {}", len);
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue