This patch makes PIO_fdopen return NULL when you give it flags it
doesn't understand. I gathered that this was the correct behavior
from the test that I untodid.
Luke
Index: t/src/io.t
===================================================================
--- t/src/io.t (revision 7981)
+++ t/src/io.t (working copy)
@@ -585,8 +585,6 @@
###############################################################################
-SKIP: {
- skip ("fdopen does not handle illegal modes correct", 1);
c_output_is($main . <<'CODE', <<'OUTPUT', "PIO_fdopen");
static opcode_t*
the_test(Interp *interpreter,
@@ -620,7 +618,6 @@
CODE
done
OUTPUT
-}
###############################################################################
Index: io/io.c
===================================================================
--- io/io.c (revision 7981)
+++ io/io.c (working copy)
@@ -730,6 +730,8 @@
}
flags = PIO_parse_open_flags(sflags);
+ if (!flags) return NULL;
+
io = PIO_fdopen_down(interpreter, layer, fd, flags);
/* io could be null here but we still have to
* to create a PMC for the caller, no PMCNULL here