Module Name: src
Committed By: joerg
Date: Fri Jul 5 09:55:39 UTC 2013
Modified Files:
src/tests/lib/libexecinfo: t_backtrace.c
Log Message:
Put the vfork at the end.
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libexecinfo/t_backtrace.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/lib/libexecinfo/t_backtrace.c
diff -u src/tests/lib/libexecinfo/t_backtrace.c:1.7 src/tests/lib/libexecinfo/t_backtrace.c:1.8
--- src/tests/lib/libexecinfo/t_backtrace.c:1.7 Thu Jul 4 23:53:13 2013
+++ src/tests/lib/libexecinfo/t_backtrace.c Fri Jul 5 09:55:39 2013
@@ -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 @@ myfunc3(size_t ncalls)
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 @@ myfunc3(size_t ncalls)
}
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);