Potential SIGPIPEs on a write to a socket that's been shut down would
kill the example without letting it print any explanation to user.
---
examples/https-client-test.c | 2 +-
examples/https-server-test.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/examples/https-client-test.c b/examples/https-client-test.c
index 55709dc..9454a1d 100644
--- a/examples/https-client-test.c
+++ b/examples/https-client-test.c
@@ -86,7 +86,7 @@ static void https_tls_write(const uint8_t *data, size_t len, void
*user_data)
int r;
while (len) {
- r = write(l_io_get_fd(io), data, len);
+ r = send(l_io_get_fd(io), data, len, MSG_NOSIGNAL);
if (r < 0) {
l_main_quit();
break;
diff --git a/examples/https-server-test.c b/examples/https-server-test.c
index 73ea6ad..da44af8 100644
--- a/examples/https-server-test.c
+++ b/examples/https-server-test.c
@@ -89,7 +89,7 @@ static void https_tls_write(const uint8_t *data, size_t len, void
*user_data)
int r;
while (len) {
- r = write(l_io_get_fd(io), data, len);
+ r = send(l_io_get_fd(io), data, len, MSG_NOSIGNAL);
if (r < 0) {
l_main_quit();
break;
--
2.19.1