[svn:parrot] r40033 - branches/io_cleanups/src/io

Infinoid at svn.parrot.org Infinoid at svn.parrot.org
Sun Jul 12 22:12:30 UTC 2009


Author: Infinoid
Date: Sun Jul 12 22:12:30 2009
New Revision: 40033
URL: https://trac.parrot.org/parrot/changeset/40033

Log:
Handle closed stdin/stdout/stderr on UNIX.

Modified:
   branches/io_cleanups/src/io/unix.c

Modified: branches/io_cleanups/src/io/unix.c
==============================================================================
--- branches/io_cleanups/src/io/unix.c	Sun Jul 12 22:10:51 2009	(r40032)
+++ branches/io_cleanups/src/io/unix.c	Sun Jul 12 22:12:30 2009	(r40033)
@@ -113,19 +113,16 @@
         PMC *filehandle;
 
         filehandle = Parrot_io_fdopen_unix(interp, PMCNULL, STDIN_FILENO, PIO_F_READ);
-        if (PMC_IS_NULL(filehandle))
-            return -1;
-        _PIO_STDIN(interp) = filehandle;
+        if (!PMC_IS_NULL(filehandle))
+            _PIO_STDIN(interp) = filehandle;
 
         filehandle = Parrot_io_fdopen_unix(interp, PMCNULL, STDOUT_FILENO, PIO_F_WRITE);
-        if (PMC_IS_NULL(filehandle))
-            return -1;
-        _PIO_STDOUT(interp) = filehandle;
+        if (!PMC_IS_NULL(filehandle))
+            _PIO_STDOUT(interp) = filehandle;
 
         filehandle = Parrot_io_fdopen_unix(interp, PMCNULL, STDERR_FILENO, PIO_F_WRITE);
-        if (PMC_IS_NULL(filehandle))
-            return -1;
-        _PIO_STDERR(interp) = filehandle;
+        if (!PMC_IS_NULL(filehandle))
+            _PIO_STDERR(interp) = filehandle;
 
         return 0;
     }


More information about the parrot-commits mailing list