diff options
| author | millert <> | 2021-09-27 19:33:58 +0000 |
|---|---|---|
| committer | millert <> | 2021-09-27 19:33:58 +0000 |
| commit | 842ed2553c219ff2ae380950dd12c78460204d65 (patch) | |
| tree | 915311a05d080b4c9ea5aa4d20ff5ed38598e3b0 /src | |
| parent | 0d190b8ad0f9df69b48642aefe26dfa48cc6fca4 (diff) | |
| download | openbsd-842ed2553c219ff2ae380950dd12c78460204d65.tar.gz openbsd-842ed2553c219ff2ae380950dd12c78460204d65.tar.bz2 openbsd-842ed2553c219ff2ae380950dd12c78460204d65.zip | |
Mark "failures" volatile to avoid a problem with sigsetjmp/siglongjmp.
This makes the test pass on sparc64 where the compiler may otherwise
store the variable in the strlcpy/strlcat function's delay slot.
OK kettenis@
Diffstat (limited to 'src')
| -rw-r--r-- | src/regress/lib/libc/strlcat/strlcattest.c | 4 | ||||
| -rw-r--r-- | src/regress/lib/libc/strlcpy/strlcpytest.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/regress/lib/libc/strlcat/strlcattest.c b/src/regress/lib/libc/strlcat/strlcattest.c index 00a9212eb5..a86fbed843 100644 --- a/src/regress/lib/libc/strlcat/strlcattest.c +++ b/src/regress/lib/libc/strlcat/strlcattest.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: strlcattest.c,v 1.4 2021/09/01 09:26:32 jasper Exp $ */ | 1 | /* $OpenBSD: strlcattest.c,v 1.5 2021/09/27 19:33:58 millert Exp $ */ |
| 2 | 2 | ||
| 3 | /* | 3 | /* |
| 4 | * Copyright (c) 2014 Todd C. Miller <millert@openbsd.org> | 4 | * Copyright (c) 2014 Todd C. Miller <millert@openbsd.org> |
| @@ -41,7 +41,7 @@ main(int argc, char *argv[]) | |||
| 41 | char *buf, *cp, *ep; | 41 | char *buf, *cp, *ep; |
| 42 | struct sigaction sa; | 42 | struct sigaction sa; |
| 43 | size_t len, bufsize; | 43 | size_t len, bufsize; |
| 44 | int failures = 0; | 44 | volatile int failures = 0; |
| 45 | 45 | ||
| 46 | bufsize = getpagesize(); /* trigger guard pages easily */ | 46 | bufsize = getpagesize(); /* trigger guard pages easily */ |
| 47 | buf = malloc(bufsize); | 47 | buf = malloc(bufsize); |
diff --git a/src/regress/lib/libc/strlcpy/strlcpytest.c b/src/regress/lib/libc/strlcpy/strlcpytest.c index 8f1d12dbce..ebc1c56a45 100644 --- a/src/regress/lib/libc/strlcpy/strlcpytest.c +++ b/src/regress/lib/libc/strlcpy/strlcpytest.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: strlcpytest.c,v 1.4 2021/09/01 09:26:32 jasper Exp $ */ | 1 | /* $OpenBSD: strlcpytest.c,v 1.5 2021/09/27 19:33:58 millert Exp $ */ |
| 2 | 2 | ||
| 3 | /* | 3 | /* |
| 4 | * Copyright (c) 2014 Todd C. Miller <millert@openbsd.org> | 4 | * Copyright (c) 2014 Todd C. Miller <millert@openbsd.org> |
| @@ -41,7 +41,7 @@ main(int argc, char *argv[]) | |||
| 41 | char *buf, *buf2, *cp, *ep; | 41 | char *buf, *buf2, *cp, *ep; |
| 42 | struct sigaction sa; | 42 | struct sigaction sa; |
| 43 | size_t len, bufsize; | 43 | size_t len, bufsize; |
| 44 | int failures = 0; | 44 | volatile int failures = 0; |
| 45 | 45 | ||
| 46 | bufsize = getpagesize(); /* trigger guard pages easily */ | 46 | bufsize = getpagesize(); /* trigger guard pages easily */ |
| 47 | buf = malloc(bufsize); | 47 | buf = malloc(bufsize); |
