skalibs

Mirror/fork of https://skarnet.org/software/skalibs/
git clone https://ccx.te2000.cz/git/skalibs
Log | Files | Refs | README | LICENSE

sig_restoreto.c (337B)


      1 /* ISC license. */
      2 
      3 /* MT-unsafe */
      4 
      5 #include <errno.h>
      6 #include <signal.h>
      7 
      8 #include <skalibs/sig.h>
      9 
     10 void sig_restoreto (sigset_t const *set, unsigned int n)
     11 {
     12   int e = errno ;
     13   unsigned int i = 1 ;
     14   for (; i < n ; i++)
     15   {
     16     int h = sigismember(set, i) ;
     17     if (h < 0) continue ;
     18     if (h) sig_restore(i) ;
     19   }
     20   errno = e ;
     21 }