]> Savannah Git Hosting - gnulib.git/commitdiff
term-style-control: Fix gcc warning on mingw.
authorBruno Haible <bruno@clisp.org>
Sat, 27 Apr 2019 02:00:17 +0000 (04:00 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 27 Apr 2019 02:00:17 +0000 (04:00 +0200)
* lib/term-style-control.c (ensure_other_signal_handlers): Reduce scope
of i.

ChangeLog
lib/term-style-control.c

index 988ee014e98a11368099860006f3552f32c17407..a433bd8324f60576895d795e639f0f7169bb1f38 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2019-04-27  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        pipe-filter-gi, pipe-filter-ii: Fix gcc warning.
index 4d2b8ee1de308497001291eb7c6063f1709a632d..a22342c828239ac23b48cb93700a694ecad2d43a 100644 (file)
@@ -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