Don't make the extra check for errno == EINVAL MinGW specific.

This saves an #ifdef. There is precedent for an extra check without #ifdef
brackets already in refs.c (Solaris). The check for EINVAL shouldn't hurt.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
This commit is contained in:
Johannes Sixt
2007-12-08 23:15:32 +01:00
parent b54486636e
commit 370a1dad18

View File

@@ -34,16 +34,12 @@ void maybe_flush_or_die(FILE *f, const char *desc)
return;
}
if (fflush(f)) {
#ifndef __MINGW32__
if (errno == EPIPE)
#else
/*
* On Windows, EPIPE is returned only by the first write()
* after the reading end has closed its handle; subsequent
* write()s return EINVAL.
*/
if (errno == EPIPE || errno == EINVAL)
#endif
exit(0);
die("write failure on %s: %s", desc, strerror(errno));
}