This commit is contained in:
Kovid Goyal 2024-01-19 21:48:40 +05:30
parent e7e401c8dd
commit 2707c44f0f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -52,20 +52,13 @@ func read_input(input_file *os.File, input_file_name string, input_channel chan<
}
}
read_with_retry := func(b []byte) (n int, err error) {
for {
n, err = input_file.Read(b)
if err != unix.EAGAIN && err != unix.EINTR {
break
}
}
return
}
for err != nil {
n, err = read_with_retry(buf_array[:])
n, err = input_file.Read(buf_array[:])
if n > 0 {
process_chunk(buf_array[:n])
}
if err == unix.EAGAIN || err == unix.EINTR {
err = nil
}
}
}