Project/Real_code/gnu/coreutils-5.0/src/ls.c
static void
sighandler (int sig)
{
#ifndef SA_NOCLDSTOP
  signal (sig, SIG_IGN);
#endif

  restore_default_color ();

  /* SIGTSTP is special, since the application can receive that signal more
     than once.  In this case, don't set the signal handler to the default.
     Instead, just raise the uncatchable SIGSTOP.  */
  if (sig == SIGTSTP)
    {
      sig = SIGSTOP;
    }
  else
    {
#ifdef SA_NOCLDSTOP
      struct sigaction sigact;

      sigact.sa_handler = SIG_DFL;
      sigemptyset (&sigact.sa_mask);
      sigact.sa_flags = 0;
      sigaction (sig, &sigact, NULL);
#else
      signal (sig, SIG_DFL);
#endif
    }

  raise (sig);
}
/* Upon interrupt, suspend, hangup, etc. ensure that the
   terminal text color is restored to the default.  */
Upon interrupt, suspend, hangup, etc. ensure that the
terminal text color is restored to the default.
Upon interrupt suspend hangup etc . ensure that the terminal text color is restored to the default .
static void
sighandler (int sig)
{
#ifndef SA_NOCLDSTOP
  signal (sig, SIG_IGN);
#endif
  restore_default_color ();
  if (sig == SIGTSTP)
    {
      sig = SIGSTOP;
    }
  else
    {
#ifdef SA_NOCLDSTOP
      struct sigaction sigact;
      sigact.sa_handler = SIG_DFL;
      sigemptyset (&sigact.sa_mask);
      sigact.sa_flags = 0;
      sigaction (sig, &sigact, NULL);
#else
      signal (sig, SIG_DFL);
#endif
    }
  raise (sig);
}
static void sighandler ( int sig ) { #ifndef SA_NOCLDSTOP signal ( sig , SIG_IGN ) ; #endif restore_default_color ( ) ; if ( sig == SIGTSTP ) { sig = SIGSTOP ; } else { #ifdef SA_NOCLDSTOP struct sigaction sigact ; sigact . sa_handler = SIG_DFL ; sigemptyset ( & sigact . sa_mask ) ; sigact . sa_flags = 0 ; sigaction ( sig , & sigact , NULL ) ; #else signal ( sig , SIG_DFL ) ; #endif } raise ( sig ) ; }
Upon interrupt, suspend, hangup, etc.
Upon interrupt suspend hangup etc .
/* SIGTSTP is special, since the application can receive that signal more
     than once.  In this case, don't set the signal handler to the default.
     Instead, just raise the uncatchable SIGSTOP.  */