Skip to content

Commit

Permalink
libisns: remove sighold and sigrelse
Browse files Browse the repository at this point in the history
The man page says that these are deprecated. Use sugprocmask as a replacement.
  • Loading branch information
neheb committed May 3, 2020
1 parent 01c58d9 commit e7dac76
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions include/libisns/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,22 @@ char * print_size(unsigned long);
*/
static inline void signals_hold(void)
{
sighold(SIGTERM);
sighold(SIGINT);
sigset_t s;

sigemptyset(&s);
sigaddset(&s, SIGTERM);
sigaddset(&s, SIGINT);
sigprocmask(SIG_BLOCK, &s, 0);
}

static inline void signals_release(void)
{
sigrelse(SIGTERM);
sigrelse(SIGINT);
sigset_t s;

sigemptyset(&s);
sigaddset(&s, SIGTERM);
sigaddset(&s, SIGINT);
sigprocmask(SIG_UNBLOCK, &s, 0);
}

/*
Expand Down

0 comments on commit e7dac76

Please sign in to comment.