Inside die(), only send the signal for subshell die support when we are
authorZac Medico <zmedico@gentoo.org>
Thu, 30 Jul 2009 07:31:06 +0000 (07:31 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 30 Jul 2009 07:31:06 +0000 (07:31 -0000)
actually in a subshell.

svn path=/main/trunk/; revision=13857

bin/isolated-functions.sh

index 8bc6f17fc8b586019f89c59089375689a2d9fecd..83270506cdb193ebf9f3b2872261483febc10749 100755 (executable)
@@ -150,7 +150,7 @@ die() {
        [ -n "$EBUILD_EXIT_STATUS_FILE" ] && > "$EBUILD_EXIT_STATUS_FILE"
 
        # subshell die support
-       kill -s SIGTERM ${EBUILD_MASTER_PID}
+       [[ $BASHPID = $EBUILD_MASTER_PID ]] || kill -s SIGTERM $EBUILD_MASTER_PID
        exit 1
 }