forked from OSchip/llvm-project
Include an error code when getRandomBytes failed.
In a rare situation, the function can fail (e.g. it fails if it cannot open /dev/urandom.) llvm-svn: 316726
This commit is contained in:
parent
6853d94e2f
commit
88f0568ce5
|
@ -386,8 +386,8 @@ void BuildIdSection::writeBuildId(ArrayRef<uint8_t> Buf) {
|
|||
});
|
||||
break;
|
||||
case BuildIdKind::Uuid:
|
||||
if (getRandomBytes(HashBuf, HashSize))
|
||||
error("entropy source failure");
|
||||
if (auto EC = getRandomBytes(HashBuf, HashSize))
|
||||
error("entropy source failure: " + EC.message());
|
||||
break;
|
||||
case BuildIdKind::Hexstring:
|
||||
memcpy(HashBuf, Config->BuildIdVector.data(), Config->BuildIdVector.size());
|
||||
|
|
Loading…
Reference in New Issue