From 0012a4f5b0b49d155ab8f71c1a7321eb013d7a0e Mon Sep 17 00:00:00 2001 From: Reyk Floeter Date: Thu, 16 Jul 2015 18:18:08 +0000 Subject: Use sysread instead of for the stream. --- regress/usr.sbin/httpd/tests/funcs.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/regress/usr.sbin/httpd/tests/funcs.pl b/regress/usr.sbin/httpd/tests/funcs.pl index c8512900522..f6503e72a11 100644 --- a/regress/usr.sbin/httpd/tests/funcs.pl +++ b/regress/usr.sbin/httpd/tests/funcs.pl @@ -1,4 +1,4 @@ -# $OpenBSD: funcs.pl,v 1.2 2015/07/16 16:38:40 reyk Exp $ +# $OpenBSD: funcs.pl,v 1.3 2015/07/16 18:18:07 reyk Exp $ # Copyright (c) 2010-2015 Alexander Bluhm # @@ -288,15 +288,15 @@ sub read_char { if (defined($max) && $max == 0) { print STDERR "Max\n"; } else { - while () { - $len += length($_); + while ((my $r = sysread(STDIN, my $buf, POSIX::BUFSIZ))) { + $_ = $buf; + $len += $r; $ctx->add($_); print STDERR "."; if (defined($max) && $len >= $max) { print STDERR "\nMax"; last; } - #sleep 1 if (($len % 512) == 0); } print STDERR "\n"; } -- cgit v1.2.3