Author: allison
Date: Thu Nov 27 17:17:50 2008
New Revision: 33285

Modified:
   branches/pdd22io_part2/src/io/api.c

Log:
[pdd22io] When attempting to read from a closed filehandle, don't just return
an empty string, throw an exception.


Modified: branches/pdd22io_part2/src/io/api.c
==============================================================================
--- branches/pdd22io_part2/src/io/api.c (original)
+++ branches/pdd22io_part2/src/io/api.c Thu Nov 27 17:17:50 2008
@@ -224,7 +224,8 @@
     INTVAL                ignored;
 
     if (Parrot_io_is_closed(interp, pmc))
-        return new_string_header(interp, 0);
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
+            "Cannot read from a closed filehandle");
 
     if (Parrot_io_get_buffer_flags(interp, pmc) & PIO_BF_MMAP) {
         res           = new_string_header(interp, 0);

Reply via email to