summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2014-01-07 02:50:34 -0500
committerRich Felker <dalias@aerifal.cx>2014-01-07 02:50:34 -0500
commit3500555db382e25b13c0832e5af13b6796cfca43 (patch)
tree0117093ffee71b8bfd682d11161b28b0c6e3bdd8
parent2c5e7560251b25b36ae3785211962e9597dc7e7d (diff)
downloadmusl-3500555db382e25b13c0832e5af13b6796cfca43.tar.gz
musl-3500555db382e25b13c0832e5af13b6796cfca43.tar.bz2
musl-3500555db382e25b13c0832e5af13b6796cfca43.tar.xz
musl-3500555db382e25b13c0832e5af13b6796cfca43.zip
fix const-correctness in sigandset/sigorset arguments
this change is consistent with the corresponding glibc functions and is semantically const-correct. the incorrect argument types without const seem to have been taken from erroneous man pages.
-rw-r--r--include/signal.h4
-rw-r--r--src/signal/sigandset.c2
-rw-r--r--src/signal/sigorset.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/include/signal.h b/include/signal.h
index 6f10a118..8ef5ff14 100644
--- a/include/signal.h
+++ b/include/signal.h
@@ -227,8 +227,8 @@ typedef void (*sig_t)(int);
typedef void (*sighandler_t)(int);
void (*bsd_signal(int, void (*)(int)))(int);
int sigisemptyset(const sigset_t *);
-int sigorset (sigset_t *, sigset_t *, sigset_t *);
-int sigandset(sigset_t *, sigset_t *, sigset_t *);
+int sigorset (sigset_t *, const sigset_t *, const sigset_t *);
+int sigandset(sigset_t *, const sigset_t *, const sigset_t *);
#define SA_NOMASK SA_NODEFER
#define SA_ONESHOT SA_RESETHAND
diff --git a/src/signal/sigandset.c b/src/signal/sigandset.c
index e0c6f486..974186f3 100644
--- a/src/signal/sigandset.c
+++ b/src/signal/sigandset.c
@@ -3,7 +3,7 @@
#define SST_SIZE (_NSIG/8/sizeof(long))
-int sigandset(sigset_t *dest, sigset_t *left, sigset_t *right)
+int sigandset(sigset_t *dest, const sigset_t *left, const sigset_t *right)
{
unsigned long i = 0, *d = (void*) dest, *l = (void*) left, *r = (void*) right;
for(; i < SST_SIZE; i++) d[i] = l[i] & r[i];
diff --git a/src/signal/sigorset.c b/src/signal/sigorset.c
index df1b1b17..ed488738 100644
--- a/src/signal/sigorset.c
+++ b/src/signal/sigorset.c
@@ -3,7 +3,7 @@
#define SST_SIZE (_NSIG/8/sizeof(long))
-int sigorset(sigset_t *dest, sigset_t *left, sigset_t *right)
+int sigorset(sigset_t *dest, const sigset_t *left, const sigset_t *right)
{
unsigned long i = 0, *d = (void*) dest, *l = (void*) left, *r = (void*) right;
for(; i < SST_SIZE; i++) d[i] = l[i] | r[i];