Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/lib/libexecinfo Put the vfork at the end.
details: https://anonhg.NetBSD.org/src/rev/16e5ef248d6a
branches: trunk
changeset: 787825:16e5ef248d6a
user: joerg <joerg%NetBSD.org@localhost>
date: Fri Jul 05 09:55:39 2013 +0000
description:
Put the vfork at the end.
diffstat:
tests/lib/libexecinfo/t_backtrace.c | 26 +++++++++++++-------------
1 files changed, 13 insertions(+), 13 deletions(-)
diffs (76 lines):
diff -r 174a05947a17 -r 16e5ef248d6a tests/lib/libexecinfo/t_backtrace.c
--- a/tests/lib/libexecinfo/t_backtrace.c Fri Jul 05 07:08:26 2013 +0000
+++ b/tests/lib/libexecinfo/t_backtrace.c Fri Jul 05 09:55:39 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_backtrace.c,v 1.7 2013/07/04 23:53:13 joerg Exp $ */
+/* $NetBSD: t_backtrace.c,v 1.8 2013/07/05 09:55:39 joerg Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: t_backtrace.c,v 1.7 2013/07/04 23:53:13 joerg Exp $");
+__RCSID("$NetBSD: t_backtrace.c,v 1.8 2013/07/05 09:55:39 joerg Exp $");
#include <atf-c.h>
#include <atf-c/config.h>
@@ -56,9 +56,6 @@
char **strings;
__CTASSERT(__arraycount(top) == __arraycount(optional_frame));
- if (prevent_inline)
- vfork();
-
min_frames = 0;
max_frames = 0;
for (j = 0; j < __arraycount(optional_frame); ++j) {
@@ -88,36 +85,39 @@
}
free(strings);
+
+ if (prevent_inline)
+ vfork();
}
static void
myfunc2(size_t ncalls)
{
+ myfunc3(ncalls);
+
if (prevent_inline)
vfork();
-
- myfunc3(ncalls);
}
static void
-myfunc1(size_t origcalls, size_t ncalls)
+myfunc1(size_t origcalls, volatile size_t ncalls)
{
- if (prevent_inline)
- vfork();
-
if (ncalls > 1)
myfunc1(origcalls, ncalls - 1);
else
myfunc2(origcalls);
+
+ if (prevent_inline)
+ vfork();
}
static void
myfunc(size_t ncalls)
{
+ myfunc1(ncalls, ncalls);
+
if (prevent_inline)
vfork();
-
- myfunc1(ncalls, ncalls);
}
ATF_TC(backtrace_fmt_basic);
Home |
Main Index |
Thread Index |
Old Index