Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libexecinfo Bail out if backtrace(3) failed.



details:   https://anonhg.NetBSD.org/src/rev/54eb57f9783d
branches:  trunk
changeset: 795455:54eb57f9783d
user:      joerg <joerg%NetBSD.org@localhost>
date:      Sun Apr 13 20:58:26 2014 +0000

description:
Bail out if backtrace(3) failed.

diffstat:

 tests/lib/libexecinfo/t_backtrace.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 9c7ce3bf7343 -r 54eb57f9783d tests/lib/libexecinfo/t_backtrace.c
--- a/tests/lib/libexecinfo/t_backtrace.c       Sun Apr 13 20:53:35 2014 +0000
+++ b/tests/lib/libexecinfo/t_backtrace.c       Sun Apr 13 20:58:26 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_backtrace.c,v 1.13 2014/03/11 13:43:23 joerg Exp $   */
+/*     $NetBSD: t_backtrace.c,v 1.14 2014/04/13 20:58:26 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.13 2014/03/11 13:43:23 joerg Exp $");
+__RCSID("$NetBSD: t_backtrace.c,v 1.14 2014/04/13 20:58:26 joerg Exp $");
 
 #include <atf-c.h>
 #include <atf-c/config.h>
@@ -79,6 +79,7 @@
                ++max_frames;
        }
        nptrs = backtrace(buffer, __arraycount(buffer));
+       ATF_REQUIRE(nptrs != (size_t)-1);
        strings = backtrace_symbols_fmt(buffer, nptrs, "%n");
 
        ATF_CHECK(strings != NULL);



Home | Main Index | Thread Index | Old Index