提交 28024f23 编写于 作者: L Laine Stump 提交者: Daniel Veillard

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.
上级 0418fa2e
......@@ -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. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册