From bd6dc293e35fdeac05bd1577593e111fd09d22b7 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 8 Apr 2017 14:37:13 +0300 Subject: Fix EPIPE handling in the MinGW build. --- awk.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'awk.h') diff --git a/awk.h b/awk.h index c1e9b4a9..a0af5793 100644 --- a/awk.h +++ b/awk.h @@ -1970,5 +1970,10 @@ erealloc_real(void *ptr, size_t count, const char *where, const char *var, const #else #define ignore_sigpipe() #define set_sigpipe_to_default() +#ifdef __MINGW32__ +/* 0xC0000008 is EXCEPTION_INVALID_HANDLE, somewhat appropriate for EPIPE */ +#define die_via_sigpipe() exit(0xC0000008) +#else /* !__MINGW32__ */ #define die_via_sigpipe() exit(EXIT_FATAL) +#endif /* !__MINGW32__ */ #endif -- cgit v1.2.1