Commit 0d4d8fd
musl: fix __stdio_read.c to conform to new Musl
We have our own copy of __stdio_read.c because it was too complicated
to take Musl's as-is because of locking differences. However, there was
one recent change to that file we forgot to take:
In commit f92804188 in Musl's repository, Rich Felker (in Feb. 2018),
changed fread() to assume that f->read() returns 0 on error, instead
of -1. The same patch fixes __stdio_read() to return 0, and we need
to do this as well.
Without this patch, when the new Musl's fread() encounters an error (e.g.,
when you try to read from a directory), it will go into an infinite
loop - each iteration increases the remaining bytes (by 1) instead of
decreasing it by the number of read bytes as normal.
Signed-off-by: Nadav Har'El <nyh@scylladb.com>
Message-Id: <20201228135352.3246222-1-nyh@scylladb.com>1 parent d70d093 commit 0d4d8fd
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
0 commit comments