Author: leo
Date: Thu May 5 04:44:08 2005
New Revision: 7982
Modified:
trunk/io/io.c
trunk/t/src/io.t
Log:
[PATCH] make PIO_fdopen return NULL on incorrect flags
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.
Courtesy of Luke Palmer <[EMAIL PROTECTED]>
Modified: trunk/io/io.c
==============================================================================
--- trunk/io/io.c (original)
+++ trunk/io/io.c Thu May 5 04:44:08 2005
@@ -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
Modified: trunk/t/src/io.t
==============================================================================
--- trunk/t/src/io.t (original)
+++ trunk/t/src/io.t Thu May 5 04:44:08 2005
@@ -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
-}
###############################################################################