summaryrefslogtreecommitdiff
path: root/src/libstddjb/selfpipe_trapset.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-04-28 10:35:45 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-04-28 10:35:45 +0000
commitdfca03df0761c526bba84af0baa37ac9dbb5b42d (patch)
tree8aa342f6a8217dd2489a2a02f10f0f8ac32c59e3 /src/libstddjb/selfpipe_trapset.c
parent3d480e3f202fc895fc7d36bcf94c654765f647dd (diff)
downloadskalibs-dfca03df0761c526bba84af0baa37ac9dbb5b42d.tar.xz
Fix NSIG definition (max+1 instead of max)
Diffstat (limited to 'src/libstddjb/selfpipe_trapset.c')
-rw-r--r--src/libstddjb/selfpipe_trapset.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstddjb/selfpipe_trapset.c b/src/libstddjb/selfpipe_trapset.c
index ed09b50..33ac861 100644
--- a/src/libstddjb/selfpipe_trapset.c
+++ b/src/libstddjb/selfpipe_trapset.c
@@ -37,7 +37,7 @@ int selfpipe_trapset (sigset_t const *set)
{
unsigned int i = 1 ;
if (selfpipe_fd < 0) return (errno = EBADF, -1) ;
- for (; i <= NSIG ; i++)
+ for (; i < NSIG ; i++)
{
int h = sigismember(set, i) ;
if (h < 0) continue ;
@@ -50,7 +50,7 @@ int selfpipe_trapset (sigset_t const *set)
if (sig_restore(i) < 0) break ;
}
}
- if (i <= NSIG)
+ if (i < NSIG)
{
int e = errno ;
sig_restoreto(set, i) ;