Source-Changes-HG archive

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

[src/trunk]: src/tests/lib/libexecinfo t_sig_backtrace: Flush stdout before w...



details:   https://anonhg.NetBSD.org/src/rev/4e720628eb4c
branches:  trunk
changeset: 377305:4e720628eb4c
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Thu Jul 06 20:44:55 2023 +0000

description:
t_sig_backtrace: Flush stdout before writing to STDOUT_FILENO.

Avoids confusing ordering of output.

diffstat:

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

diffs (26 lines):

diff -r 8475a93247e9 -r 4e720628eb4c tests/lib/libexecinfo/t_sig_backtrace.c
--- a/tests/lib/libexecinfo/t_sig_backtrace.c   Thu Jul 06 07:59:00 2023 +0000
+++ b/tests/lib/libexecinfo/t_sig_backtrace.c   Thu Jul 06 20:44:55 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_sig_backtrace.c,v 1.6 2022/07/25 22:43:01 riastradh Exp $    */
+/*     $NetBSD: t_sig_backtrace.c,v 1.7 2023/07/06 20:44:55 riastradh Exp $    */
 
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_sig_backtrace.c,v 1.6 2022/07/25 22:43:01 riastradh Exp $");
+__RCSID("$NetBSD: t_sig_backtrace.c,v 1.7 2023/07/06 20:44:55 riastradh Exp $");
 
 #include <sys/mman.h>
 #include <execinfo.h>
@@ -132,6 +132,7 @@ handler(int s)
        ATF_REQUIRE(size != 0);
 
        printf("Backtrace %zd stack frames.\n", size);
+       fflush(stdout);
        backtrace_symbols_fd(array, size, STDOUT_FILENO);
 
        char **strings = backtrace_symbols_fmt(array, size, "%n");



Home | Main Index | Thread Index | Old Index