summaryrefslogtreecommitdiff
path: root/src/libstddjb/sig_restoreto.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2023-04-07 01:17:04 +0000
committerLaurent Bercot <ska@appnovation.com>2023-04-07 01:17:04 +0000
commit51e253133a87a72cfde9ce6bd8c12544b54721cb (patch)
tree67b532e4342f569cb89967a5c2349acddbfb5133 /src/libstddjb/sig_restoreto.c
parent1d152882ecd60c177a09e84db4ea8766945e87b2 (diff)
downloadskalibs-51e253133a87a72cfde9ce6bd8c12544b54721cb.tar.xz
Add selfpipe_fd(), refactor selfpipe
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/libstddjb/sig_restoreto.c')
-rw-r--r--src/libstddjb/sig_restoreto.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libstddjb/sig_restoreto.c b/src/libstddjb/sig_restoreto.c
index 1a9250e..e40f75b 100644
--- a/src/libstddjb/sig_restoreto.c
+++ b/src/libstddjb/sig_restoreto.c
@@ -2,12 +2,14 @@
/* MT-unsafe */
+#include <errno.h>
#include <signal.h>
#include <skalibs/sig.h>
void sig_restoreto (sigset_t const *set, unsigned int n)
{
+ int e = errno ;
unsigned int i = 1 ;
for (; i < n ; i++)
{
@@ -15,4 +17,5 @@ void sig_restoreto (sigset_t const *set, unsigned int n)
if (h < 0) continue ;
if (h) sig_restore(i) ;
}
+ errno = e ;
}