From d54947bda2dd59a0a9e60a89d8a55bb9f2d92315 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 27 Apr 2019 04:00:17 +0200 Subject: [PATCH] term-style-control: Fix gcc warning on mingw. * lib/term-style-control.c (ensure_other_signal_handlers): Reduce scope of i. --- ChangeLog | 6 +++++ lib/term-style-control.c | 58 +++++++++++++++++++++------------------- 2 files changed, 36 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index 988ee014e9..a433bd8324 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2019-04-27 Bruno Haible + + term-style-control: Fix gcc warning on mingw. + * lib/term-style-control.c (ensure_other_signal_handlers): Reduce scope + of i. + 2019-04-26 Bruno Haible pipe-filter-gi, pipe-filter-ii: Fix gcc warning. diff --git a/lib/term-style-control.c b/lib/term-style-control.c index 4d2b8ee1de..a22342c828 100644 --- a/lib/term-style-control.c +++ b/lib/term-style-control.c @@ -812,41 +812,43 @@ ensure_other_signal_handlers (void) if (!signal_handlers_installed) { - unsigned int i; - /* Install the handlers for the fatal signals. */ at_fatal_signal (fatal_signal_handler); #if defined SIGCONT /* Install the handlers for the stopping and continuing signals. */ - for (i = 0; i < num_job_control_signals; i++) - { - int sig = job_control_signals[i]; + { + unsigned int i; - if (sig == SIGCONT) - /* Already handled in ensure_continuing_signal_handler. */ - ; - else if (!is_ignored (sig)) - { - struct sigaction action; - action.sa_handler = &stopping_signal_handler; - /* If we get a stopping or continuing signal while executing - stopping_signal_handler, enter it recursively, since it is - reentrant. Hence no SA_RESETHAND. */ - action.sa_flags = SA_NODEFER; - sigemptyset (&action.sa_mask); - sigaction (sig, &action, NULL); - } - #if DEBUG_SIGNALS - else - { - fprintf (stderr, "Signal %d is ignored. Not installing a handler!\n", - sig); - fflush (stderr); - } - #endif - } + for (i = 0; i < num_job_control_signals; i++) + { + int sig = job_control_signals[i]; + + if (sig == SIGCONT) + /* Already handled in ensure_continuing_signal_handler. */ + ; + else if (!is_ignored (sig)) + { + struct sigaction action; + action.sa_handler = &stopping_signal_handler; + /* If we get a stopping or continuing signal while executing + stopping_signal_handler, enter it recursively, since it is + reentrant. Hence no SA_RESETHAND. */ + action.sa_flags = SA_NODEFER; + sigemptyset (&action.sa_mask); + sigaction (sig, &action, NULL); + } + #if DEBUG_SIGNALS + else + { + fprintf (stderr, "Signal %d is ignored. Not installing a handler!\n", + sig); + fflush (stderr); + } + #endif + } + } #endif -- 2.39.5