Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/posix/popen.c')
-rw-r--r--newlib/libc/posix/popen.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/newlib/libc/posix/popen.c b/newlib/libc/posix/popen.c
index d6d174d08..f522c0b9d 100644
--- a/newlib/libc/posix/popen.c
+++ b/newlib/libc/posix/popen.c
@@ -71,7 +71,12 @@ popen(program, type)
FILE *iop;
int pdes[2], pid;
- if ((*type != 'r' && *type != 'w') || type[1]) {
+ if ((*type != 'r' && *type != 'w')
+ || (type[1]
+#ifdef __CYGWIN__
+ && (type[2] || (type[1] != 'b' && type[1] != 't'))
+#endif
+ )) {
errno = EINVAL;
return (NULL);
}