Merge "Utils: correctly handle read() errors in ReadRandomBytes()"

This commit is contained in:
Eric Biggers 2019-01-22 18:14:49 +00:00 committed by Gerrit Code Review
commit a2bd436594

View file

@ -377,7 +377,7 @@ status_t ReadRandomBytes(size_t bytes, char* buf) {
return -errno;
}
size_t n;
ssize_t n;
while ((n = TEMP_FAILURE_RETRY(read(fd, &buf[0], bytes))) > 0) {
bytes -= n;
buf += n;