Changeset 72de5f in git for Singular/cntrlc.cc


Ignore:
Timestamp:
Feb 4, 2013, 4:45:59 PM (11 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
Children:
9bc6a43bf738fd99b4fb51230cb0c76f2ffee68d
Parents:
b7e0a075c343b4225cf6b4a64667feb0927313e2
Message:
chg: sigaction instead of signachg: sigaction instead of signal

from master
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/cntrlc.cc

    rb7e0a0 r72de5f  
    132132si_hdl_typ si_set_signal ( int sig, si_hdl_typ signal_handler)
    133133{
     134#if 0
    134135  si_hdl_typ retval=signal (sig, (si_hdl_typ)signal_handler);
    135136  if (retval == SIG_ERR)
     
    138139  }
    139140#ifdef HAVE_SIGINTERRUPT
    140   siginterrupt(sig, 1);
     141  siginterrupt(sig, 0);
     142  /*system calls will be restarted if interrupted by  the  specified
     143   * signal sig.  This is the default behavior in Linux.
     144   */
     145#endif
     146#else
     147  struct sigaction new_action,old_action;
     148
     149  /* Set up the structure to specify the new action. */
     150  new_action.sa_handler = signal_handler;
     151  if (sig==SIGINT)
     152    sigemptyset (&new_action.sa_mask);
     153  else
     154    new_action.sa_flags = SA_RESTART;
     155
     156  int r=sigaction (sig, &new_action, &old_action);
     157  si_hdl_typ retval=(si_hdl_typ)old_action.sa_handler;
     158  if (r == -1)
     159  {
     160     fprintf(stderr, "Unable to init signal %d ... exiting...\n", sig);
     161     retval=SIG_ERR;
     162  }
    141163#endif
    142164  return retval;
Note: See TracChangeset for help on using the changeset viewer.