]> git.tuebingen.mpg.de Git - paraslash.git/commit
Return from filter_setup() so callers can reset the terminal.
authorAndre Noll <maan@tuebingen.mpg.de>
Wed, 23 Nov 2022 18:21:25 +0000 (19:21 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Fri, 19 Apr 2024 18:41:23 +0000 (20:41 +0200)
commitd955fb7bc5640767c14560e06e6f9c47d3cb49c5
tree8cee88f2a70c65d55a7b00977cff1d64c00fe128
parent14e29dffee6eb83cd1c7c5575a073c4dc2836a61
Return from filter_setup() so callers can reset the terminal.

This function of filter_common.c calls exit(3) on errors. This is OK
for para_filter and para_audiod, but not for para_play because there
the function is called after readline has initialized the terminal for
its own use. If the function calls exit(3), the terminal settings are
not reset as they should have been. This can be observed for example
on the attempt to open an mp3 file with an para_play executable that
lacks mp3 support.

This commit changes the function to return an error code instead and
deals with the fallout in the three callers. Although play.c already
had error checking for calls to filter_setup(), it still needs a minor
tweak because we now have to deal with the fact that the filter and
writer node don't exist in eof_cleanup().
audiod.c
filter.c
filter_common.c
play.c