From 4a83b453bb7e901a7bc03048bd87581453ce1e99 Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Wed, 24 Feb 2016 20:28:48 -0800 Subject: [PATCH] Ask for SIGPIPE not to be sent, instead of ignoring it. --- adsbus/send.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/adsbus/send.c b/adsbus/send.c index 52e009c..871c7cc 100644 --- a/adsbus/send.c +++ b/adsbus/send.c @@ -1,11 +1,11 @@ #include #include -#include #include #include #include #include #include +#include #include #include "airspy_adsb.h" @@ -88,14 +88,13 @@ static bool send_hello(int fd, struct serializer *serializer) { if (buf.length == 0) { return true; } - if (write(fd, buf_at(&buf, 0), buf.length) != buf.length) { + if (send(fd, buf_at(&buf, 0), buf.length, MSG_NOSIGNAL) != buf.length) { return false; } return true; } void send_init() { - signal(SIGPIPE, SIG_IGN); } void send_cleanup() {