]> 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, 26 May 2024 16:24:22 +0000 (18:24 +0200)
commit65b5042f307aebb25eed0ba42e05023ac2798b79
treee3b1177501cd73dd42d54544bc4f242a40ed8635
parent799a29ac430a70a24dc71e415c2a819cfe08dbd3
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