aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/control.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/control.c b/src/control.c
index 322646b..5cea4e0 100644
--- a/src/control.c
+++ b/src/control.c
@@ -11,6 +11,7 @@
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
+#include <signal.h>
#include <sys/socket.h>
#include <sys/un.h>
@@ -508,6 +509,10 @@ static void service_client(GB *gb, int i) {
// ---------------------------------------------------------------------------
void control_open(const char *path) {
+ // A client can connect and vanish before we finish writing (e.g. a liveness
+ // probe that connects and closes without reading the greeting). Ignore
+ // SIGPIPE so those writes fail with EPIPE instead of killing the emulator.
+ signal(SIGPIPE, SIG_IGN);
for (int i = 0; i < MAX_CLIENTS; i++) clients[i].fd = -1;
listen_fd = socket(AF_UNIX, SOCK_STREAM, 0);