summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2014-11-25 08:22:10 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2014-11-25 08:22:10 +0000
commitd6c9c688f0be8ecfed51ad280e48bb87c5625bd9 (patch)
tree165474ec116818817c8d61ca498227d6db72384c
parente050079344996aa607f02a811a11080fe71d5547 (diff)
set ttyout to line buffered, because the signal handler writes are
non-buffered. They were getting out of order. from Kaspars Bankovskis, discussion included millert
-rw-r--r--usr.bin/ftp/fetch.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/ftp/fetch.c b/usr.bin/ftp/fetch.c
index 97790a21783..7c9d768b6c8 100644
--- a/usr.bin/ftp/fetch.c
+++ b/usr.bin/ftp/fetch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fetch.c,v 1.134 2014/10/31 13:48:21 jsing Exp $ */
+/* $OpenBSD: fetch.c,v 1.135 2014/11/25 08:22:09 deraadt Exp $ */
/* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */
/*-
@@ -515,6 +515,10 @@ noslash:
}
#endif /* !SMALL */
+ /* ensure consistent order of the output */
+ if (verbose)
+ setvbuf(ttyout, NULL, _IOLBF, 0);
+
s = -1;
for (res = res0; res; res = res->ai_next) {
if (getnameinfo(res->ai_addr, res->ai_addrlen, hbuf,