cppfiles.c (open_file): Change mode (DJGPP only) of redirected input to O_BINARY.

* cppfiles.c (open_file): Change mode (DJGPP only) of redirected
	input to O_BINARY.

From-SVN: r53431
This commit is contained in:
Andris Pavenis 2002-05-13 23:28:28 +03:00 committed by Neil Booth
parent 859f7aaf41
commit 85be8c2de8
2 changed files with 14 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2002-05-13 Andris Pavenis <pavenis@lanet.lv>
* cppfiles.c (open_file): Change mode (DJGPP only) of redirected
input to O_BINARY.
2002-05-13 Jeffrey A Law (law@redhat.com)
* i386.c (ia32_multipass_dfa_lookahead): Prototype.

View File

@ -270,7 +270,15 @@ open_file (pfile, filename)
Special case: the empty string is translated to stdin. */
if (filename[0] == '\0')
file->fd = 0;
{
file->fd = 0;
#ifdef __DJGPP__
/* For DJGPP redirected input is opened in text mode. Change it
to binary mode. */
if (! isatty (file->fd))
setmode (file->fd, O_BINARY);
#endif
}
else
file->fd = open (file->name, O_RDONLY | O_NOCTTY | O_BINARY, 0666);