On Sat 16 Jul 2016 13:24, Eli Zaretskii <e...@gnu.org> writes: > diff --git a/libguile/filesys.c b/libguile/filesys.c > index 48232e8..c47c2f4 100644 > --- a/libguile/filesys.c > +++ b/libguile/filesys.c > @@ -1472,6 +1472,14 @@ SCM_DEFINE (scm_mkstemp, "mkstemp!", 1, 0, 0, > SCM_SYSCALL (rv = mkstemp (c_tmpl)); > if (rv == -1) > SCM_SYSERROR; > +#ifdef __MINGW32__ > + /* Files created by this function are used for *.go files, so make > + sure they use binary I/O, or else the produced *.go files will be > + corrupted by end-of-line conversion and ^Z "software EOF" > + misfeature. Gnulib's 'mkstemp' uses the default text mode to > + open the file . */ > + _setmode (rv, _O_BINARY); > +#endif
This function is used for other purposes as well. I think the right thing here is to use the mkostemp gnulib module instead and pass O_BINARY in the flags. I have made this change in git; please let me know if it causes problems for you. Andy