mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-10 00:45:41 +01:00
Next fix in safe_read
This commit is contained in:
parent
76702105ec
commit
9d3cbc3833
1 changed files with 2 additions and 1 deletions
|
@ -589,7 +589,8 @@ ssize_t safe_read(int fd, void *buf, size_t count)
|
|||
ssize_t result = 0, res;
|
||||
|
||||
while (count > 0) {
|
||||
res = read(fd, buf, count);
|
||||
if ((res = read(fd, buf, count)) == 0)
|
||||
break;
|
||||
if (res < 0)
|
||||
return result > 0 ? result : res;
|
||||
count -= res;
|
||||
|
|
Loading…
Reference in a new issue