diff --git a/miniserv.pl b/miniserv.pl index 25fe55aa1..2aebd593b 100755 --- a/miniserv.pl +++ b/miniserv.pl @@ -988,8 +988,7 @@ while(1) { # this sub-process is asking about a password local $infd = $passin[$i]; local $outfd = $passout[$i]; - #local $inline = <$infd>; - local $inline = &sysread_line($infd); + local $inline = <$infd>; if ($inline) { print DEBUG "main: inline $inline"; } @@ -3086,22 +3085,6 @@ else { } } -# sysread_line(fh) -# Read a line from a file handle, using sysread to get a byte at a time -sub sysread_line -{ -local ($fh) = @_; -local $line; -while(1) { - local ($buf, $got); - $got = sysread($fh, $buf, 1); - last if ($got <= 0); - $line .= $buf; - last if ($buf eq "\n"); - } -return $line; -} - # wait_for_data(secs) # Waits at most the given amount of time for some data on SOCK, returning # 0 if not found, 1 if some arrived.