From 67dae4936e98efb936b1d613c77f02cc305a5d8f Mon Sep 17 00:00:00 2001 From: thor Date: Sat, 26 Jul 2025 20:25:16 +0000 Subject: [PATCH] mpg123: fix regression of signals for terminal control since 1.31 (get rid of signal()) git-svn-id: svn://scm.orgis.org/mpg123/trunk@5511 35dc7657-300d-0410-a2e5-dc2837fedb53 --- NEWS | 4 ++++ src/term_posix.c | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index b25da606..f5a50535 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,10 @@ -- The ports/cmake only installs manpages for BUILD_PROGRAMS now. -- The configure gives better hint if pkg-config was missing during generation (bug 378). +- mpg123: +-- Replace usage of signal() in terminal code with our sigaction() wrapper + to fix repeated handling for --sigusr1 and --sigusr2, which got subtly + broken on Linux + glibc by a feature test macro change in mpg123 1.31. 1.33.0 ------ diff --git a/src/term_posix.c b/src/term_posix.c index b262b7cd..fde077bc 100644 --- a/src/term_posix.c +++ b/src/term_posix.c @@ -112,10 +112,10 @@ static int term_setup_detail(struct termios *pattern) { mdebug("setup on fd %d", term_fd); - /* One might want to use sigaction instead. */ - signal(SIGCONT, term_sigcont); - signal(SIGUSR1, term_sigusr); - signal(SIGUSR2, term_sigusr); + INT123_catchsignal(SIGCONT, term_sigcont); + INT123_catchsignal(SIGUSR1, term_sigusr); + INT123_catchsignal(SIGUSR2, term_sigusr); + struct termios tio = *pattern; tio.c_lflag &= ~(ICANON|ECHO); tio.c_cc[VMIN] = 1;