Skip to content

Commit

Permalink
IPC: do not bail on events from unknown file descriptors ref. #433
Browse files Browse the repository at this point in the history
The natural cycle for dwm-msg is that:
   - the client registers
   - the client sends a message
   - a response is sent back
   - the client deregisters

There is a race condition such that a new client may end up with the same
file descriptor as another command that is deregistering, resulting in a
message to come through from a file descriptor that is not registered.

The handling of this situation is that the IPC patch will log:

   Got event from unknown fd 7, ptr 0x7, u32 7, u64 7 with events 17

before gracefully stopping (exiting) dwm.

The consequence of the error itself seems benign and the proposal here is
to allow dwm to keep running despite not being able to process the dwm-msg
command successfully.
  • Loading branch information
bakkeby committed Aug 1, 2024
1 parent f425874 commit 36cbcf5
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion dwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -3313,7 +3313,6 @@ run(void)
event_fd, events[i].data.ptr, events[i].data.u32,
events[i].data.u64);
fprintf(stderr, " with events %d\n", events[i].events);
return;
}
}
}
Expand Down

0 comments on commit 36cbcf5

Please sign in to comment.