summaryrefslogtreecommitdiff
path: root/universal.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2013-08-07 12:23:57 +0200
committerNicholas Clark <nick@ccl4.org>2013-08-11 16:01:22 +0200
commit53f2736e93810ee2954fb2a08b4d43366caae935 (patch)
tree44867278ec72bd598fbd42027b4f20b03796f816 /universal.c
parent7682ed921500841e8c45793174078f853106a4c4 (diff)
downloadperl-53f2736e93810ee2954fb2a08b4d43366caae935.tar.gz
test.pl's runperl() can now optionally redirect STDIN from /dev/null
There is existing code to pipe fixed input to the test perl's STDIN, which means that STDIN can be made to be an immediate end-of-file by giving an empty string. However, it turns out that on platforms which use ksh as /bin/sh, ksh's setup of shell pipelines differs from a traditional Bourne shell (and bash), using one less process in total, with the result that the test perl starts with a child process already - the process piping to its STDIN. This unexpected child process confuses tests for wait() which are only expecting to see return values from processes that the test script itself started. As the problem case is specifically for setting up STDIN to be at EOF, it's easier to it by enhancing test.pl's runperl() to be able to redirect STDIN from the null device than by making the tests themselves more complex. This approach also avoids spawning a process for quite a few of the tests. Fortuitously it seems that the string /dev/null is portable enough to work with the command line parsing code on VMS and Win32 too. Thanks to Zefram for helping diagnose the problem. It turns out that this also fixes regressions on VMS, where the pipe implementation returns the exit code of the process at the front of the pipeline, not the end. The result is that adding a pipeline messes up any test using OPTION FATAL to check exit status.
Diffstat (limited to 'universal.c')
0 files changed, 0 insertions, 0 deletions