Merge "Utils: correctly handle read() errors in ReadRandomBytes()" am: a2bd436594
am: 038a274e8a
Change-Id: I64d09e4a3164749a915b079dcffe56940182a7d2
This commit is contained in:
commit
e5296cc04d
1 changed files with 1 additions and 1 deletions
|
@ -377,7 +377,7 @@ status_t ReadRandomBytes(size_t bytes, char* buf) {
|
||||||
return -errno;
|
return -errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t n;
|
ssize_t n;
|
||||||
while ((n = TEMP_FAILURE_RETRY(read(fd, &buf[0], bytes))) > 0) {
|
while ((n = TEMP_FAILURE_RETRY(read(fd, &buf[0], bytes))) > 0) {
|
||||||
bytes -= n;
|
bytes -= n;
|
||||||
buf += n;
|
buf += n;
|
||||||
|
|
Loading…
Reference in a new issue