[PATCH] make PIO_fdopen return NULL on incorrect flags

Skip to first unread message

Luke Palmer

May 5, 2005, 2:35:42 AM5/5/05
to perl6-i...@perl.org
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.



Leopold Toetsch

May 5, 2005, 7:44:33 AM5/5/05
to Luke Palmer, perl6-i...@perl.org
Luke Palmer <lrpa...@gmail.com> wrote:

> Luke

Thanks, applied.


May 5, 2005, 8:44:24 AM5/5/05
to l...@toetsch.at, Luke Palmer, perl6-i...@perl.org
Actually no, from the PIO routines you should return a PMC
that has a null handle, or that was my original intent. I think
I was considering changing new_io_pmc() to return something
like ParrotUndef in that case but never did. The very first
version of the IO routines actually did return NULL for every
error, but it was decided that wasn't the cleanest way.

If you look at the revision history of io.c, revision 4673, I commented:

Bug fixes. We should not be returning NULL for io PMCs, that generates
an exception now.. A PMC should be returned with a NULL ParrotIO * for
valid eof/bool tests.
As this was 2003, I honestly don't remember all of the discussion.

There might be a record of it between Dan and me in the
archives, however, chances are it was on IRC.


Reply all
Reply to author
0 new messages