From f77e1318c515d495ac9c08bdfdf2dadf79a9649f Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 1 Dec 2021 22:42:07 +0200 Subject: Convert w32_maybe_set_errno to os_maybe_set_errno. --- main.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 288833ae..f666619c 100644 --- a/main.c +++ b/main.c @@ -654,10 +654,8 @@ By default it reads standard input and writes standard output.\n\n"), fp); fflush(fp); if (ferror(fp)) { -#ifdef __MINGW32__ - if (errno == 0 || errno == EINVAL) - w32_maybe_set_errno(); -#endif + os_maybe_set_errno(); + /* don't warn about stdout/stderr if EPIPE, but do error exit */ if (errno == EPIPE) die_via_sigpipe(); @@ -704,10 +702,8 @@ along with this program. If not, see http://www.gnu.org/licenses/.\n"); fflush(stdout); if (ferror(stdout)) { -#ifdef __MINGW32__ - if (errno == 0 || errno == EINVAL) - w32_maybe_set_errno(); -#endif + os_maybe_set_errno(); + /* don't warn about stdout if EPIPE, but do error exit */ if (errno != EPIPE) warning(_("error writing standard output: %s"), strerror(errno)); -- cgit v1.2.3