summaryrefslogtreecommitdiff
path: root/regress/sys
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2016-09-28 08:55:12 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2016-09-28 08:55:12 +0000
commit08e52b906477c70b49c49d211c473b0449b9f066 (patch)
tree919913283c943cc8d5f9e55a832b8d1017c1b9f9 /regress/sys
parentb4b3b4e5850d7eca47a4e2449525916e05967028 (diff)
If stdout is not line buffered, messages got lost when assert() was
called. Print errors to stderr instead.
Diffstat (limited to 'regress/sys')
-rw-r--r--regress/sys/kern/siginfo-fault/siginfo-fault.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/regress/sys/kern/siginfo-fault/siginfo-fault.c b/regress/sys/kern/siginfo-fault/siginfo-fault.c
index ed8ef0a9104..d71bff7481c 100644
--- a/regress/sys/kern/siginfo-fault/siginfo-fault.c
+++ b/regress/sys/kern/siginfo-fault/siginfo-fault.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: siginfo-fault.c,v 1.2 2014/06/24 19:05:42 matthew Exp $ */
+/* $OpenBSD: siginfo-fault.c,v 1.3 2016/09/28 08:55:11 bluhm Exp $ */
/*
* Copyright (c) 2014 Google Inc.
*
@@ -48,21 +48,25 @@ checksig(int expsigno, int expcode, volatile char *expaddr)
{
int fail = 0;
if (expsigno != gotsigno) {
- printf("signo: expect %d (%s)", expsigno, strsignal(expsigno));
- printf(", actual %d (%s)\n", gotsigno, strsignal(gotsigno));
+ fprintf(stderr, "signo: expect %d (%s), actual %d (%s)\n",
+ expsigno, strsignal(expsigno),
+ gotsigno, strsignal(gotsigno));
++fail;
}
if (expsigno != gotsi.si_signo) {
- printf("signo: expect %d (%s)", expsigno, strsignal(expsigno));
- printf(", actual %d (%s)\n", gotsi.si_signo, strsignal(gotsi.si_signo));
+ fprintf(stderr, "signo: expect %d (%s), actual %d (%s)\n",
+ expsigno, strsignal(expsigno),
+ gotsi.si_signo, strsignal(gotsi.si_signo));
++fail;
}
if (expcode != gotsi.si_code) {
- printf("si_code: expect %d, actual %d\n", expcode, gotsi.si_code);
+ fprintf(stderr, "si_code: expect %d, actual %d\n",
+ expcode, gotsi.si_code);
++fail;
}
if (expaddr != gotsi.si_addr) {
- printf("si_addr: expect %p, actual %p\n", expaddr, gotsi.si_addr);
+ fprintf(stderr, "si_addr: expect %p, actual %p\n",
+ expaddr, gotsi.si_addr);
++fail;
}
CHECK_EQ(0, fail);