This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
amigaos4: save and restore stdio handles around exec
[perl5.git] / doio.c
diff --git a/doio.c b/doio.c
index cf76114..d8ea076 100644 (file)
--- a/doio.c
+++ b/doio.c
@@ -1705,16 +1705,7 @@ Perl_do_exec3(pTHX_ const char *incmd, int fd, int do_report)
            PERL_FPU_POST_EXEC
            S_exec_failed(aTHX_ PL_sh_path, fd, do_report);
 #if defined (__amigaos4__)
-           /* We *must* write something to our pipe or else
-            * the other end hangs */
-           {
-               int e = errno;
-
-               if (do_report) {
-                   PerlLIO_write(fd, (void*)&e, sizeof(int));
-                   PerlLIO_close(fd);
-               }
-           }
+            amigaos_post_exec(fd, do_report);
 #endif
            Safefree(buf);
            return DO_EXEC_RETVAL(result);