aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Blass <tobiasblass@t-online.de>2018-06-20 21:35:15 +0200
committerTobias Blass <t-blass@t-blass.de>2018-06-20 22:00:45 +0200
commit482fc48c74361dd8b1adf0f5c14abd8e82f35bf6 (patch)
treed44415104f661f759db44e36ec2169ecd868c231
parentcc89906ddfe249c59cfa35babf1aeccaae3b5e26 (diff)
FIX: Suprocess loops endlessly when the control socket closes.
recvmsg(3) returns 0 if the connection partner has shut down its socket. The communicate function considered 0 a successful message, though, and keeps calling recvmsg(3) again and again.
-rw-r--r--backend/session/direct-ipc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/backend/session/direct-ipc.c b/backend/session/direct-ipc.c
index 6c69b70a..f8ba07f7 100644
--- a/backend/session/direct-ipc.c
+++ b/backend/session/direct-ipc.c
@@ -130,7 +130,7 @@ static void communicate(int sock) {
int drm_fd = -1;
bool running = true;
- while (running && recv_msg(sock, &drm_fd, &msg, sizeof(msg)) >= 0) {
+ while (running && recv_msg(sock, &drm_fd, &msg, sizeof(msg)) > 0) {
switch (msg.type) {
case MSG_OPEN:
errno = 0;