diff options
Diffstat (limited to 'src/regress/lib/libc/setjmp')
| -rw-r--r-- | src/regress/lib/libc/setjmp/Makefile | 11 | ||||
| -rw-r--r-- | src/regress/lib/libc/setjmp/jmptest.c | 22 |
2 files changed, 14 insertions, 19 deletions
diff --git a/src/regress/lib/libc/setjmp/Makefile b/src/regress/lib/libc/setjmp/Makefile index 25bf99d4cb..fc68e8d44c 100644 --- a/src/regress/lib/libc/setjmp/Makefile +++ b/src/regress/lib/libc/setjmp/Makefile | |||
| @@ -1,16 +1,9 @@ | |||
| 1 | # $OpenBSD: Makefile,v 1.3 2002/01/01 23:00:51 art Exp $ | ||
| 1 | # $NetBSD: Makefile,v 1.2 1995/04/20 22:40:13 cgd Exp $ | 2 | # $NetBSD: Makefile,v 1.2 1995/04/20 22:40:13 cgd Exp $ |
| 2 | 3 | ||
| 3 | PROG= setjmptest | 4 | PROG= setjmptest |
| 4 | SRCS= jmptest.c | 5 | SRCS= jmptest.c |
| 5 | NOMAN= noman, no way, man | ||
| 6 | 6 | ||
| 7 | CFLAGS+= -DTEST_SETJMP | 7 | CFLAGS+= -DTEST_SETJMP |
| 8 | 8 | ||
| 9 | .PATH: ${.CURDIR}/../setjmp | 9 | .include <bsd.regress.mk> |
| 10 | |||
| 11 | install: | ||
| 12 | |||
| 13 | regress: ${PROG} | ||
| 14 | ./${PROG} | ||
| 15 | |||
| 16 | .include <bsd.prog.mk> | ||
diff --git a/src/regress/lib/libc/setjmp/jmptest.c b/src/regress/lib/libc/setjmp/jmptest.c index f2cecc9178..9512c9ee34 100644 --- a/src/regress/lib/libc/setjmp/jmptest.c +++ b/src/regress/lib/libc/setjmp/jmptest.c | |||
| @@ -1,3 +1,4 @@ | |||
| 1 | /* $OpenBSD: jmptest.c,v 1.7 2003/09/02 23:52:16 david Exp $ */ | ||
| 1 | /* $NetBSD: jmptest.c,v 1.2 1995/01/01 20:55:35 jtc Exp $ */ | 2 | /* $NetBSD: jmptest.c,v 1.2 1995/01/01 20:55:35 jtc Exp $ */ |
| 2 | 3 | ||
| 3 | /* | 4 | /* |
| @@ -32,10 +33,12 @@ | |||
| 32 | */ | 33 | */ |
| 33 | 34 | ||
| 34 | #include <sys/types.h> | 35 | #include <sys/types.h> |
| 36 | #include <err.h> | ||
| 35 | #include <setjmp.h> | 37 | #include <setjmp.h> |
| 36 | #include <signal.h> | 38 | #include <signal.h> |
| 37 | #include <stdio.h> | 39 | #include <stdio.h> |
| 38 | #include <stdlib.h> | 40 | #include <stdlib.h> |
| 41 | #include <string.h> | ||
| 39 | #include <unistd.h> | 42 | #include <unistd.h> |
| 40 | 43 | ||
| 41 | #if (TEST_SETJMP + TEST_U_SETJMP + TEST_SIGSETJMP) != 1 | 44 | #if (TEST_SETJMP + TEST_U_SETJMP + TEST_SIGSETJMP) != 1 |
| @@ -62,21 +65,20 @@ | |||
| 62 | 65 | ||
| 63 | int expectsignal; | 66 | int expectsignal; |
| 64 | 67 | ||
| 65 | void | 68 | static void |
| 66 | aborthandler(signo) | 69 | aborthandler(int signo) |
| 67 | int signo; | ||
| 68 | { | 70 | { |
| 69 | 71 | ||
| 70 | if (expectsignal) | 72 | if (expectsignal) |
| 71 | exit(0); | 73 | _exit(0); |
| 72 | else | 74 | else { |
| 73 | errx(1, "kill(SIGABRT) succeeded"); | 75 | warnx("kill(SIGABRT) succeeded"); |
| 76 | _exit(1); | ||
| 77 | } | ||
| 74 | } | 78 | } |
| 75 | 79 | ||
| 76 | int | 80 | int |
| 77 | main(argc, argv) | 81 | main(int argc, char *argv[]) |
| 78 | int argc; | ||
| 79 | char *argv[]; | ||
| 80 | { | 82 | { |
| 81 | struct sigaction sa; | 83 | struct sigaction sa; |
| 82 | BUF jb; | 84 | BUF jb; |
| @@ -101,7 +103,7 @@ main(argc, argv) | |||
| 101 | #endif | 103 | #endif |
| 102 | 104 | ||
| 103 | sa.sa_handler = aborthandler; | 105 | sa.sa_handler = aborthandler; |
| 104 | sa.sa_mask = 0; | 106 | sigemptyset(&sa.sa_mask); |
| 105 | sa.sa_flags = 0; | 107 | sa.sa_flags = 0; |
| 106 | if (sigaction(SIGABRT, &sa, NULL) == -1) | 108 | if (sigaction(SIGABRT, &sa, NULL) == -1) |
| 107 | err(1, "sigaction failed"); | 109 | err(1, "sigaction failed"); |
