diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2015-07-16 18:18:08 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2015-07-16 18:18:08 +0000 |
commit | 0012a4f5b0b49d155ab8f71c1a7321eb013d7a0e (patch) | |
tree | 03def0295f271ba24be54bf4acd9e8766b5ec45b /regress/usr.sbin | |
parent | e6d6ce9be69ad8242a8dc9b2d22cdaaba84ac614 (diff) |
Use sysread instead of <STDIN> for the stream.
Diffstat (limited to 'regress/usr.sbin')
-rw-r--r-- | regress/usr.sbin/httpd/tests/funcs.pl | 8 |
1 files 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 <bluhm@openbsd.org> # @@ -288,15 +288,15 @@ sub read_char { if (defined($max) && $max == 0) { print STDERR "Max\n"; } else { - while (<STDIN>) { - $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"; } |