mirror of
https://github.com/rtlsdrblog/rtl-sdr-blog.git
synced 2025-07-09 10:55:11 +02:00
Fix signal handler from getting stuck in an endless loop
The signal handler for SIGINT/TERM/QUIT and, importantly, SIGPIPE tries to write an informational message to stderr. When however stderr is redirected to a closed pipe, this will cause (another) SIGPIPE, and in turn the signal handler will get called again, and again and again. Since we intend to exit rtl_fm anyways, we can just ignore this signal.
This commit is contained in:
committed by
Steve Markgraf
parent
5e73f90f1d
commit
142325a93c
@ -144,6 +144,7 @@ sighandler(int signum)
|
||||
#else
|
||||
static void sighandler(int signum)
|
||||
{
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
fprintf(stderr, "Signal caught, exiting!\n");
|
||||
rtlsdr_cancel_async(dev);
|
||||
do_exit = 1;
|
||||
|
Reference in New Issue
Block a user