]> 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>
Sat, 18 May 2024 20:03:59 +0000 (22:03 +0200)
commit0c2cf19f2ddde31a89980a9cf4f3b51ba7cab285
treed313ae62364f3bc9c6ef0b222f5fd4d881d5d0d2
parentfabb41c959d66624375ed82a2f53dcb2f6fcde07
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