From 9786108a04deecb0e162069b254d0ffa78910d01 Mon Sep 17 00:00:00 2001 From: Joel Schmitz Date: Thu, 9 Apr 2026 11:59:43 +0100 Subject: [PATCH] Prevent SIGPIPE being sent on lost connection --- src/async.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/async.c b/src/async.c index a92032cc..e8834765 100644 --- a/src/async.c +++ b/src/async.c @@ -28,6 +28,9 @@ typedef SSIZE_T ssize_t; #ifndef MSG_DONTWAIT #define MSG_DONTWAIT 0 #endif +#ifndef MSG_NOSIGNAL +#define MSG_NOSIGNAL 0 +#endif struct mpd_async { mpd_socket_t fd; @@ -214,7 +217,7 @@ mpd_async_write(struct mpd_async *async) return true; nbytes = send(async->fd, mpd_buffer_read(&async->output), size, - MSG_DONTWAIT); + MSG_DONTWAIT | MSG_NOSIGNAL); if (nbytes < 0) { /* I/O error */