From 34e0aabc51074a2476d27148c4f755d558da3ec9 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 12 Mar 2025 01:31:21 +0100 Subject: Better handle subprocess crashes On my machine EOF doesn't trigger POLLHUP (not sure why), instead read() returns zero. It just prints the following message in a loop: [comm.c:101] Failed to read pw result: Success Better handle this case in read_comm_reply() by making a difference between a failed read() and a failed authentication. --- include/comm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/comm.h') diff --git a/include/comm.h b/include/comm.h index defc2f4..cd94094 100644 --- a/include/comm.h +++ b/include/comm.h @@ -11,7 +11,7 @@ bool write_comm_reply(bool success); // Requests the provided password to be checked. The password is always cleared // when the function returns. bool write_comm_request(struct swaylock_password *pw); -bool read_comm_reply(void); +bool read_comm_reply(bool *auth_success); // FD to poll for password authentication replies. int get_comm_reply_fd(void); -- cgit v1.2.3