pub const SIG_IGN: u8 = 2;
Change SIGPIPE to SIG_IGN so that failed writes results in EPIPE that are eventually converted to ErrorKind::BrokenPipe.
SIGPIPE
SIG_IGN
EPIPE
ErrorKind::BrokenPipe