blob: fd9f6c2aaf62c8a188ed88ae7538e045396fc80d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
/* ISC license. */
/* MT-unsafe */
#include <skalibs/sysdeps.h>
#ifdef SKALIBS_HASSIGNALFD
#include <signal.h>
#include <skalibs/djbunix.h>
#include "selfpipe-internal.h"
#include <skalibs/selfpipe.h>
void selfpipe_finish (void)
{
sigprocmask(SIG_UNBLOCK, &selfpipe_caught, 0) ;
sigemptyset(&selfpipe_caught) ;
fd_close(selfpipe_fd) ;
selfpipe_fd = -1 ;
}
#else
#include <skalibs/nonposix.h>
#include <signal.h>
#include <skalibs/sig.h>
#include <skalibs/nsig.h>
#include <skalibs/djbunix.h>
#include "selfpipe-internal.h"
#include <skalibs/selfpipe.h>
void selfpipe_finish (void)
{
sig_restoreto(&selfpipe_caught, NSIG-1) ;
sigemptyset(&selfpipe_caught) ;
fd_close(selfpipe[1]) ;
fd_close(selfpipe[0]) ;
selfpipe[0] = selfpipe[1] = -1 ;
}
#endif
|