New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redirecting standard streams in Proc causes wrong exit code #4531
Comments
From @ShimmerFairy$ perl6 -e 'say ?run("false")' It appears that specifying any kind of standard stream fails to set the exit code properly ("false" is either a shell built-in or a program otherwise available on linux that does nothing but give a failing exit code). It appears to be down at the VM level, so I don't know if the problem exists on both Moar and JVM. On MoarVM at least, it seems that asking for any of those streams doesn't set up a pointer to the exit-code variable in the struct used to execute a new process. For reference, bash at least still returns the appropriate exit code: $ false </dev/null >/dev/null 2>/dev/null |
From @FROGGSThing is that you do not redirect, you capture the streams. So if you capture out, you need to read the output and close it. The return value of close will then tell you the right exit code. It will start to run when you feed it input and close in, or when you read its output and close that stream. |
The RT System itself - Status changed from 'new' to 'open' |
@FROGGS - Status changed from 'open' to 'rejected' |
From @FROGGSThing is that you do not redirect, you capture the streams. So if you capture out, you need to read the output and close it. The |
Migrated from rt.perl.org#126037 (status was 'rejected')
Searchable as RT126037$
The text was updated successfully, but these errors were encountered: