9fans / plan9port

Plan 9 from User Space
https://9fans.github.io/plan9port/
Other
1.64k stars 326 forks source link

[rc] flag e + causes double fork(), which renders $apid unreliable #437

Open dexen opened 4 years ago

dexen commented 4 years ago

test script:

#!/usr/bin/env rc

flag e -
echo flag e - works as expected:
rc -c 'echo inner pid: $pid' &
echo outer pid: $apid
wait

flag e +
echo flag e + bugs out:
rc -c 'echo inner pid with e +: $pid' &
echo outer pid with e +: $apid
wait

output:

flag e - works as expected: outer pid: 20923 inner pid: 20923 flag e + bugs out: outer pid with e +: 20927 inner pid with e +: 20929