summaryrefslogtreecommitdiff
path: root/regress/sys/kern
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2016-03-17 19:40:44 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2016-03-17 19:40:44 +0000
commitd56c7210e6997f393bece0935d359c05d01a0efa (patch)
tree9807932348e40879566df0fc405cff1a547d791d /regress/sys/kern
parente3a77a309cd3e34064bed90fbff49f7c78cfb732 (diff)
Last parameter to execl[e]() functions *must* be cast to a pointer.
Just NULL is not good practise as NULL is theoretically allowed to be an integer rather than a pointer. Use (char *)NULL consistently instead of scattering a few (char *)0 and (void *)NULL into the mix. Prompted by and probably ok deraadt@ millert@ kettenis@ Definitely ok mestre@ ratchov@
Diffstat (limited to 'regress/sys/kern')
-rw-r--r--regress/sys/kern/exec_self/exec_self.c4
-rw-r--r--regress/sys/kern/kqueue/kqueue-process.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/regress/sys/kern/exec_self/exec_self.c b/regress/sys/kern/exec_self/exec_self.c
index 4bf39af5f7c..7d3e67a441a 100644
--- a/regress/sys/kern/exec_self/exec_self.c
+++ b/regress/sys/kern/exec_self/exec_self.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec_self.c,v 1.1 2002/08/17 22:58:59 art Exp $ */
+/* $OpenBSD: exec_self.c,v 1.2 2016/03/17 19:40:43 krw Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org> 2002 Public Domain.
*/
@@ -36,7 +36,7 @@ main(int argc, char **argv)
MADV_FREE))
err(1, "madvise");
- if (execl(argv[0], argv[0], &blob.string, NULL))
+ if (execl(argv[0], argv[0], &blob.string, (char *)NULL))
err(1, "execl");
/* NOTREACHED */
diff --git a/regress/sys/kern/kqueue/kqueue-process.c b/regress/sys/kern/kqueue/kqueue-process.c
index d4dfa8d02e9..d62b2699d18 100644
--- a/regress/sys/kern/kqueue/kqueue-process.c
+++ b/regress/sys/kern/kqueue/kqueue-process.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kqueue-process.c,v 1.8 2015/08/13 10:26:54 uebayasi Exp $ */
+/* $OpenBSD: kqueue-process.c,v 1.9 2016/03/17 19:40:43 krw Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org> 2002 Public Domain
*/
@@ -151,7 +151,7 @@ process_child(void)
case 0:
/* sync 2.1 */
pause();
- execl("/usr/bin/true", "true", (void *)NULL);
+ execl("/usr/bin/true", "true", (char *)NULL);
err(1, "execl(true)");
}