From acb87ec6566df0983bb1e9789ba5181747b4e203 Mon Sep 17 00:00:00 2001 From: millert <> Date: Mon, 27 Sep 2021 19:33:58 +0000 Subject: 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@ --- src/regress/lib/libc/strlcat/strlcattest.c | 4 ++-- 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 @@ -/* $OpenBSD: strlcattest.c,v 1.4 2021/09/01 09:26:32 jasper Exp $ */ +/* $OpenBSD: strlcattest.c,v 1.5 2021/09/27 19:33:58 millert Exp $ */ /* * Copyright (c) 2014 Todd C. Miller @@ -41,7 +41,7 @@ main(int argc, char *argv[]) char *buf, *cp, *ep; struct sigaction sa; size_t len, bufsize; - int failures = 0; + volatile int failures = 0; bufsize = getpagesize(); /* trigger guard pages easily */ 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 @@ -/* $OpenBSD: strlcpytest.c,v 1.4 2021/09/01 09:26:32 jasper Exp $ */ +/* $OpenBSD: strlcpytest.c,v 1.5 2021/09/27 19:33:58 millert Exp $ */ /* * Copyright (c) 2014 Todd C. Miller @@ -41,7 +41,7 @@ main(int argc, char *argv[]) char *buf, *buf2, *cp, *ep; struct sigaction sa; size_t len, bufsize; - int failures = 0; + volatile int failures = 0; bufsize = getpagesize(); /* trigger guard pages easily */ buf = malloc(bufsize); -- cgit v1.2.3-55-g6feb