[PATCH] On non-Cygwin, use O_TEXT when O_BINARY is not set.

Michael Haubenwallner <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
* libc/stdio/flags.c (__sflags): Fix typo when testing if O_BINARY is
set, to really set O_TEXT if not O_BINARY, applies to non-Cygwin only.
---
 newlib/libc/stdio/flags.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/newlib/libc/stdio/flags.c b/newlib/libc/stdio/flags.c
index 71fc1f60a..cd73385ce 100644
--- a/newlib/libc/stdio/flags.c
+++ b/newlib/libc/stdio/flags.c
@@ -90,7 +90,7 @@ __sflags (struct _reent *ptr,
 	}
     }
 #if defined (O_TEXT) && !defined (__CYGWIN__)
-  if (!(m | O_BINARY))
+  if (!(m & O_BINARY))
     m |= O_TEXT;
 #endif
   *optr = m | o;
-- 
2.19.2
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.