]> 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>
Sun, 17 Mar 2024 11:35:07 +0000 (12:35 +0100)
commitb3ca15a62c2973cf6acd72198c418628a49caf03
tree8cee88f2a70c65d55a7b00977cff1d64c00fe128
parent5ad491a3d8fa203cec38d3168e410a9c3124e473
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 was observed on the attempt
to open an mp3 file with an executable that lacked mp3 support because
the libmad package was missing.

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