[svn:parrot] r38721 - trunk/src/io

NotFound at svn.parrot.org NotFound at svn.parrot.org
Tue May 12 20:09:16 UTC 2009


Author: NotFound
Date: Tue May 12 20:09:14 2009
New Revision: 38721
URL: https://trac.parrot.org/parrot/changeset/38721

Log:
[core] fix pipe open in unix, tested only for reading

Modified:
   trunk/src/io/unix.c

Modified: trunk/src/io/unix.c
==============================================================================
--- trunk/src/io/unix.c	Tue May 12 18:23:03 2009	(r38720)
+++ trunk/src/io/unix.c	Tue May 12 20:09:14 2009	(r38721)
@@ -641,6 +641,8 @@
 #  ifdef PARROT_HAS_HEADER_UNISTD
     int pid, err, fds[2];
 
+    Parrot_io_eprintf(interp, "open pipe: '%Ss' - %i\n", command, flags);
+
     err = pipe(fds);
     if (err < 0) {
         return NULL;
@@ -695,6 +697,13 @@
                 exit(EXIT_SUCCESS);
         }
 
+        /*******************************************************
+         *     THIS IS A QUICK TEST IMPLEMENTATION
+         * Thus the ifdef'ed out code is not deleted yet
+         * TT #661
+         *******************************************************
+         */
+        #if 0
         /* XXX ugly hack to be able to pass some arguments
          *     split cmd at blanks */
         orig_cmd = cmd = Parrot_str_to_cstring(interp, command);
@@ -710,6 +719,16 @@
 
         Parrot_str_free_cstring(c); /* done with C string */
         execv(cmd, argv);       /* XXX use execvp ? */
+        #else
+
+        orig_cmd = cmd = Parrot_str_to_cstring(interp, command);
+        argv [0] = "/bin/sh";
+        argv [1] = "-c";
+        argv [2] = cmd;
+        argv [3] = NULL;
+        execv(argv [0], argv);
+
+        #endif
 
         /* Will never reach this unless exec fails. */
         Parrot_str_free_cstring(orig_cmd);


More information about the parrot-commits mailing list