Only use O_BINARY on Win32

This commit is contained in:
Oliver Jowett 2014-10-01 12:17:51 +01:00
parent c09c68466c
commit 98c7c73d06

View file

@ -710,7 +710,13 @@ int main(int argc, char **argv) {
} else { } else {
if (Modes.filename[0] == '-' && Modes.filename[1] == '\0') { if (Modes.filename[0] == '-' && Modes.filename[1] == '\0') {
Modes.fd = STDIN_FILENO; Modes.fd = STDIN_FILENO;
} else if ((Modes.fd = open(Modes.filename, (O_RDONLY | O_BINARY))) == -1) { } else if ((Modes.fd = open(Modes.filename,
#ifdef _WIN32
(O_RDONLY | O_BINARY)
#else
(O_RDONLY)
#endif
)) == -1) {
perror("Opening data file"); perror("Opening data file");
exit(1); exit(1);
} }