summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2021-05-10 10:26:24 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2021-05-10 10:26:24 +0000
commit1bf12be60359f337adf0cf8df3b0eee8a9e8a216 (patch)
tree7fc42d650625bce86a93db57dc7516f2e6631ace /regress
parentc7042c1b6f66756c2acdabf9c4c30c68d00097b1 (diff)
Better way to detect the double new lines the API issues from time to time.
This way done lines now will have a newline.
Diffstat (limited to 'regress')
-rw-r--r--regress/usr.sbin/bgpd/integrationtests/api-exabgp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/regress/usr.sbin/bgpd/integrationtests/api-exabgp.c b/regress/usr.sbin/bgpd/integrationtests/api-exabgp.c
index 559197706eb..d4f5426bdaa 100644
--- a/regress/usr.sbin/bgpd/integrationtests/api-exabgp.c
+++ b/regress/usr.sbin/bgpd/integrationtests/api-exabgp.c
@@ -72,7 +72,9 @@ main(int argc, char **argv)
n = read(0, buf, sizeof(buf));
if (n == -1)
err(1, "read stdin");
- if (write(2, buf, n - 1) != n - 1)
+ if (n > 2 && strncmp(buf + n - 2, "\n\n", 2) == 0)
+ n--;
+ if (write(2, buf, n) != n)
errx(1, "bad write to stderr");
if (n > 8 && strncmp(buf, "shutdown", 8) == 0)
errx(0, "exabgp shutdown");