On 2017-11-16 18:38, Cleber Rosa wrote: > The functions used in _cleanup() come from common.rc, which currently > gets sourced after _cleanup() is defined and registered as a signal > handler. When _cleanup() is executed, it has no valid references to > those functions, as BASH won't resolve the reference at that time. > > While at it, also fix some tabs versus spaces indentation in > _cleanup() in a few tests. > > Signed-off-by: Cleber Rosa <cr...@redhat.com> > ---
No real objection apart from that I can't quite reproduce the issue. When I test it, _cleanup() seems to be executed either way. And if I put #!/bin/bash foo() { bar } trap foo 2 . ./bar.sh kill -2 $$ in a file foo.sh and #!/bin/bash bar() { echo 42 } in a file bar.sh, and then execute foo.sh, I get the "42" output. Soo... It does seem to work for me? (I mean, the patch still makes sense to me in theory, so I guess I might take it anyway) Max
signature.asc
Description: OpenPGP digital signature