From c1ad1bb72586d89dafea148ea499de682594c71f Mon Sep 17 00:00:00 2001 From: Joel Schmitz Date: Thu, 9 Apr 2026 11:59:43 +0100 Subject: [PATCH 1/2] Prevent SIGPIPE being sent --- src/async.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/async.c b/src/async.c index a92032c..9711588 100644 --- a/src/async.c +++ b/src/async.c @@ -214,7 +214,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 */ From f6e878191bf3a4100716ddc64922b65861f58fab Mon Sep 17 00:00:00 2001 From: Joel Schmitz Date: Thu, 9 Apr 2026 15:37:28 +0100 Subject: [PATCH 2/2] Add MSG_NOSIGNAL definition for portability --- src/socket.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/socket.c b/src/socket.c index d5db9c8..759767c 100644 --- a/src/socket.c +++ b/src/socket.c @@ -28,6 +28,9 @@ #ifndef MSG_DONTWAIT # define MSG_DONTWAIT 0 #endif +#ifndef MSG_NOSIGNAL +# define MSG_NOSIGNAL 0 +#endif #ifdef _WIN32