diff options
author | 2019-06-17 08:19:30 +0000 | |
---|---|---|
committer | 2019-06-17 08:19:30 +0000 | |
commit | c4e5d4f56d6b3a671d8fbd3835b877daa9c02c8c (patch) | |
tree | 553a78bd2e89082dbb86776594c5b411ac14fa54 | |
parent | When reloading station address via TWSI is timed out, try to reload (diff) | |
download | wireguard-openbsd-c4e5d4f56d6b3a671d8fbd3835b877daa9c02c8c.tar.xz wireguard-openbsd-c4e5d4f56d6b3a671d8fbd3835b877daa9c02c8c.zip |
improve clock_gettime regress:
* fix compilation error due to missing cast
* do not run sysctl during make clean and the other common regress cleanup
targets
* make it work using a separate object directory
-rw-r--r-- | regress/sys/kern/clock_gettime/Makefile | 6 | ||||
-rw-r--r-- | regress/sys/kern/clock_gettime/monotonicrelapse.c | 5 |
2 files changed, 7 insertions, 4 deletions
diff --git a/regress/sys/kern/clock_gettime/Makefile b/regress/sys/kern/clock_gettime/Makefile index b8a73d7fd05..0b8bf59d9c8 100644 --- a/regress/sys/kern/clock_gettime/Makefile +++ b/regress/sys/kern/clock_gettime/Makefile @@ -1,15 +1,17 @@ -# $OpenBSD: Makefile,v 1.1 2019/06/14 19:23:53 cheloha Exp $ +# $OpenBSD: Makefile,v 1.2 2019/06/17 08:19:30 anton Exp $ PROG= monotonicrelapse LDADD+= -lpthread DPADD+= ${LIBPTHREAD} WARNINGS= yes +.if ! (make(clean) || make(cleandir) || make(obj)) NCPUONLINE!= sysctl -n hw.ncpuonline +.endif REGRESS_TARGETS+= run-regress-monotonicrelapse run-regress-monotonicrelapse: ${PROG} - ${PROG} ${NCPUONLINE} + ./${PROG} ${NCPUONLINE} .include <bsd.regress.mk> diff --git a/regress/sys/kern/clock_gettime/monotonicrelapse.c b/regress/sys/kern/clock_gettime/monotonicrelapse.c index a2239429a06..8a04d4a764f 100644 --- a/regress/sys/kern/clock_gettime/monotonicrelapse.c +++ b/regress/sys/kern/clock_gettime/monotonicrelapse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: monotonicrelapse.c,v 1.1 2019/06/14 19:23:53 cheloha Exp $ */ +/* $OpenBSD: monotonicrelapse.c,v 1.2 2019/06/17 08:19:30 anton Exp $ */ /* * Scott Cheloha <scottcheloha@gmail.com>, 2019. Public Domain. */ @@ -9,6 +9,7 @@ #include <err.h> #include <pthread.h> +#include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <time.h> @@ -50,7 +51,7 @@ main(int argc, char *argv[]) for (i = 0; i < nthreads; i++) { error = pthread_create(&thread[i], NULL, thread_func, - (void *)(i + 1)); + (void *)((uintptr_t)i + 1)); if (error) errc(1, error, "pthread_create"); } |