summaryrefslogtreecommitdiff
path: root/src/signal
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2013-12-13 02:20:07 -0500
committerRich Felker <dalias@aerifal.cx>2013-12-13 02:20:07 -0500
commita7dbcf5c8ca7edb7a46eb276031ad1df4131135b (patch)
tree969708c0db27a58609d2636c752c2e1e23406640 /src/signal
parent571744447c23f91feb6439948f3a619aca850dfb (diff)
downloadmusl-a7dbcf5c8ca7edb7a46eb276031ad1df4131135b.tar.gz
musl-a7dbcf5c8ca7edb7a46eb276031ad1df4131135b.tar.bz2
musl-a7dbcf5c8ca7edb7a46eb276031ad1df4131135b.tar.xz
musl-a7dbcf5c8ca7edb7a46eb276031ad1df4131135b.zip
use 0 instead of NULL for null pointer constants
and thereby remove otherwise-unnecessary inclusion of stddef.h
Diffstat (limited to 'src/signal')
-rw-r--r--src/signal/sighold.c3
-rw-r--r--src/signal/sigignore.c3
-rw-r--r--src/signal/siginterrupt.c5
-rw-r--r--src/signal/sigrelse.c3
-rw-r--r--src/signal/sigset.c3
-rw-r--r--src/signal/sigwait.c3
-rw-r--r--src/signal/sigwaitinfo.c3
7 files changed, 8 insertions, 15 deletions
diff --git a/src/signal/sighold.c b/src/signal/sighold.c
index 992812fd..cfa2306c 100644
--- a/src/signal/sighold.c
+++ b/src/signal/sighold.c
@@ -1,5 +1,4 @@
#include <signal.h>
-#include <stddef.h>
int sighold(int sig)
{
@@ -7,5 +6,5 @@ int sighold(int sig)
sigemptyset(&mask);
if (sigaddset(&mask, sig) < 0) return -1;
- return sigprocmask(SIG_BLOCK, &mask, NULL);
+ return sigprocmask(SIG_BLOCK, &mask, 0);
}
diff --git a/src/signal/sigignore.c b/src/signal/sigignore.c
index 78bd7474..5ba05e12 100644
--- a/src/signal/sigignore.c
+++ b/src/signal/sigignore.c
@@ -1,5 +1,4 @@
#include <signal.h>
-#include <stddef.h>
int sigignore(int sig)
{
@@ -8,5 +7,5 @@ int sigignore(int sig)
sigemptyset(&sa.sa_mask);
sa.sa_handler = SIG_IGN;
sa.sa_flags = 0;
- return sigaction(sig, &sa, NULL);
+ return sigaction(sig, &sa, 0);
}
diff --git a/src/signal/siginterrupt.c b/src/signal/siginterrupt.c
index 94f92be6..70063400 100644
--- a/src/signal/siginterrupt.c
+++ b/src/signal/siginterrupt.c
@@ -1,13 +1,12 @@
-#include <stddef.h>
#include <signal.h>
int siginterrupt(int sig, int flag)
{
struct sigaction sa;
- sigaction(sig, NULL, &sa);
+ sigaction(sig, 0, &sa);
if (flag) sa.sa_flags &= ~SA_RESTART;
else sa.sa_flags |= SA_RESTART;
- return sigaction(sig, &sa, NULL);
+ return sigaction(sig, &sa, 0);
}
diff --git a/src/signal/sigrelse.c b/src/signal/sigrelse.c
index 31c1a030..b4c5a00f 100644
--- a/src/signal/sigrelse.c
+++ b/src/signal/sigrelse.c
@@ -1,5 +1,4 @@
#include <signal.h>
-#include <stddef.h>
int sigrelse(int sig)
{
@@ -7,5 +6,5 @@ int sigrelse(int sig)
sigemptyset(&mask);
if (sigaddset(&mask, sig) < 0) return -1;
- return sigprocmask(SIG_UNBLOCK, &mask, NULL);
+ return sigprocmask(SIG_UNBLOCK, &mask, 0);
}
diff --git a/src/signal/sigset.c b/src/signal/sigset.c
index cbe46284..0d7b4564 100644
--- a/src/signal/sigset.c
+++ b/src/signal/sigset.c
@@ -1,5 +1,4 @@
#include <signal.h>
-#include <stddef.h>
void (*sigset(int sig, void (*handler)(int)))(int)
{
@@ -11,7 +10,7 @@ void (*sigset(int sig, void (*handler)(int)))(int)
return SIG_ERR;
if (handler == SIG_HOLD) {
- if (sigaction(sig, NULL, &sa_old) < 0)
+ if (sigaction(sig, 0, &sa_old) < 0)
return SIG_ERR;
if (sigprocmask(SIG_BLOCK, &mask, &mask) < 0)
return SIG_ERR;
diff --git a/src/signal/sigwait.c b/src/signal/sigwait.c
index 48a855bb..c8822eea 100644
--- a/src/signal/sigwait.c
+++ b/src/signal/sigwait.c
@@ -1,10 +1,9 @@
#include <signal.h>
-#include <stddef.h>
int sigwait(const sigset_t *restrict mask, int *restrict sig)
{
siginfo_t si;
- if (sigtimedwait(mask, &si, NULL) < 0)
+ if (sigtimedwait(mask, &si, 0) < 0)
return -1;
*sig = si.si_signo;
return 0;
diff --git a/src/signal/sigwaitinfo.c b/src/signal/sigwaitinfo.c
index c7b164df..bb51f8b5 100644
--- a/src/signal/sigwaitinfo.c
+++ b/src/signal/sigwaitinfo.c
@@ -1,7 +1,6 @@
#include <signal.h>
-#include <stddef.h>
int sigwaitinfo(const sigset_t *restrict mask, siginfo_t *restrict si)
{
- return sigtimedwait(mask, si, NULL);
+ return sigtimedwait(mask, si, 0);
}