Skip to content

Commit

Permalink
Ignore signal interruptions when waiting for epoll in x11 watcher (fixes
Browse files Browse the repository at this point in the history
 #31)

Signed-off-by: Alex Saveau <[email protected]>
  • Loading branch information
SUPERCILEX committed Aug 21, 2024
1 parent c40da68 commit 1625939
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions x11/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use ringboard_sdk::{
use rustix::{
event::epoll,
fs::{memfd_create, openat, MemfdFlags, Mode, OFlags, CWD},
io::read_uninit,
io::{read_uninit, Errno},
net::{
recvmsg, RecvAncillaryBuffer, RecvAncillaryMessage::ScmRights, RecvFlags, SocketAddrUnix,
SocketType,
Expand Down Expand Up @@ -418,8 +418,10 @@ fn run() -> Result<(), CliError> {
conn.flush()?;

trace!("Waiting for event.");
epoll::wait(&epoll, &mut epoll_events, -1)
.map_io_err(|| "Failed to wait for epoll events.")?;
match epoll::wait(&epoll, &mut epoll_events, -1) {
Err(Errno::INTR) => continue,
r => r.map_io_err(|| "Failed to wait for epoll events.")?,
};

for epoll::Event { flags: _, data } in &epoll_events {
match data.u64() {
Expand Down

0 comments on commit 1625939

Please sign in to comment.