From: Mathieu Desnoyers Date: Thu, 15 Oct 2015 16:07:46 +0000 (-0400) Subject: compat send no SIGPIPE: multithread-safe X-Git-Tag: v1.3.0~6 X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;ds=inline;h=f73291f2dcea06f87920c647135c5079ab4dfd4a;hp=f73291f2dcea06f87920c647135c5079ab4dfd4a;p=babeltrace.git compat send no SIGPIPE: multithread-safe The current implementation of the no-SIGPIPE send in the compatibility layer has side-effects on multithreaded processes due to use of sigaction(). Although multithread-safety is not strictly needed since Babeltrace is single-threaded for now, there is no reason to keep this limitation deeply rooted in a compatibility layer. Use the multithreaded-safe algorithm to catch SIGPIPE implemented in LTTng-UST for the write() system call for platforms that do not have MSG_NOSIGNAL. It was originally implented in LTTng-UST as part of the ring buffer wakeup. This is a re-implementation of this same algorithm under MIT license. It uses signal masks and sigtimedwait. Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau ---