Since SIGPIPE is no longer touched by default when MSG_NOSIGNAL is
available, it's extra-critical that all socket writes actually pass
that flag.
Signed-off-by: Will Thompson <will.thompson@collabora.co.uk>
again:
#if defined(HAVE_CMSGCRED)
- bytes_written = sendmsg (server_fd, &msg, 0);
+ bytes_written = sendmsg (server_fd, &msg, 0
+#ifdef MSG_NOSIGNAL
+ |MSG_NOSIGNAL
+#endif
+ );
#else
- bytes_written = write (server_fd, buf, 1);
+ bytes_written = send (server_fd, buf, 1, 0
+#ifdef MSG_NOSIGNAL
+ |MSG_NOSIGNAL
+#endif
+ );
#endif
if (bytes_written < 0 && errno == EINTR)