Use POSIX::_exit instead of exit in IPC::Open when exiting after an
Rafael Garcia-Suarez [Mon, 5 Jun 2006 07:50:12 +0000 (07:50 +0000)]
exec() failure, as suggested by Salvador Fandino after change #28347
p4raw-link: @28347 on //depot/perl: eee4b3e7bdad6a2c6ef0e7ee1f43200ab0fd25bb

p4raw-id: //depot/perl@28350

lib/IPC/Open3.pm

index ba41733..95313fc 100644 (file)
@@ -262,7 +262,11 @@ sub _open3 {
        }
        return 0 if ($cmd[0] eq '-');
        local($")=(" ");
-       exec @cmd or do { carp "$Me: exec of @cmd failed"; exit 255; };
+       exec @cmd or do {
+           carp "$Me: exec of @cmd failed";
+           eval { require POSIX; POSIX::_exit(255); };
+           exit 255;
+       };
     } elsif ($do_spawn) {
        # All the bookkeeping of coincidence between handles is
        # handled in spawn_with_handles.