artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8dcb626
)
Better way to detect the double new lines the API issues from time to time.
author
claudio
<claudio@openbsd.org>
Mon, 10 May 2021 10:26:23 +0000
(10:26 +0000)
committer
claudio
<claudio@openbsd.org>
Mon, 10 May 2021 10:26:23 +0000
(10:26 +0000)
This way done lines now will have a newline.
regress/usr.sbin/bgpd/integrationtests/api-exabgp.c
patch
|
blob
|
history
diff --git
a/regress/usr.sbin/bgpd/integrationtests/api-exabgp.c
b/regress/usr.sbin/bgpd/integrationtests/api-exabgp.c
index
5591977
..
d4f5426
100644
(file)
--- 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");