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:
-rw-r--r--newlib/ChangeLog5
-rw-r--r--newlib/libc/posix/popen.c7
2 files changed, 11 insertions, 1 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index 0ff7f9833..ed5b0c0d0 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,8 @@
+2002-08-04 Christopher Faylor <cgf@redhat.com>
+
+ * libc/stdio/popen.c (popen): Allow "rb", "rt", "wb", and "wt"
+ arguments for popen to match similar functionality in fopen.
+
2002-07-29 Pierre Humblet <pierre.humblet@ieee.org>
* libc/include/sys/unistd.h: Add setgroups prototype for Cygwin.
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);
}