mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-25 10:03:49 +03:00
Fix UUID random generator to use /dev/random
Only use pseudo-random generator for uuid if using /dev/random fails. * src/util/uuid.c: The original code. would only print the warning message if using /dev/random failed, but would still go ahead and call virUUIDGeneratePseudoRandomBytes in all cases anyway.
This commit is contained in:
parent
0418fa2e72
commit
28024f2311
@ -104,9 +104,10 @@ virUUIDGenerate(unsigned char *uuid)
|
||||
VIR_WARN(_("Falling back to pseudorandom UUID,"
|
||||
" failed to generate random bytes: %s"),
|
||||
virStrerror(err, ebuf, sizeof ebuf));
|
||||
err = virUUIDGeneratePseudoRandomBytes(uuid, VIR_UUID_BUFLEN);
|
||||
}
|
||||
|
||||
return virUUIDGeneratePseudoRandomBytes(uuid, VIR_UUID_BUFLEN);
|
||||
return(err);
|
||||
}
|
||||
|
||||
/* Convert C from hexadecimal character to integer. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user