Re: [PATCH 5/5] test-lib-functions: detect test_when_finished in subshell

2015-09-06 Thread Eric Sunshine
On Sun, Sep 6, 2015 at 7:46 AM, John Keeping wrote: > On Sun, Sep 06, 2015 at 05:51:43AM -0400, Eric Sunshine wrote: >> I'm not necessarily advocating this, but think it's worth mentioning >> that an alternate solution would be to fix test_when_finished() to work >> correctly in subshells rather t

Re: [PATCH 5/5] test-lib-functions: detect test_when_finished in subshell

2015-09-06 Thread John Keeping
On Sun, Sep 06, 2015 at 05:51:43AM -0400, Eric Sunshine wrote: > On Sat, Sep 5, 2015 at 9:12 AM, John Keeping wrote: > > test_when_finished does nothing in a subshell because the change to > > test_cleanup does not affect the parent. > > > > There is no POSIX way to detect that we are in a subshel

Re: [PATCH 5/5] test-lib-functions: detect test_when_finished in subshell

2015-09-06 Thread Eric Sunshine
On Sat, Sep 5, 2015 at 9:12 AM, John Keeping wrote: > test_when_finished does nothing in a subshell because the change to > test_cleanup does not affect the parent. > > There is no POSIX way to detect that we are in a subshell ($$ and $PPID > are specified to remain unchanged), but we can detect i

[PATCH 5/5] test-lib-functions: detect test_when_finished in subshell

2015-09-05 Thread John Keeping
test_when_finished does nothing in a subshell because the change to test_cleanup does not affect the parent. There is no POSIX way to detect that we are in a subshell ($$ and $PPID are specified to remain unchanged), but we can detect it on Bash and fall back to ignoring the bug on other shells.