]> git.proxmox.com Git - mirror_qemu.git/commit
crypto: Do not fail for EINTR during qcrypto_random_bytes
authorRichard Henderson <richard.henderson@linaro.org>
Thu, 14 Mar 2019 03:47:32 +0000 (20:47 -0700)
committerRichard Henderson <richard.henderson@linaro.org>
Wed, 22 May 2019 16:38:54 +0000 (12:38 -0400)
commit25fb26e4f4b7cd50b9a7314400a2f800a4082b71
tree294e9e3735a2f0a34f05b9ce877ad6ae3e2432f2
parent14a356f47560c8275b8e04fbee484a617fc45f80
crypto: Do not fail for EINTR during qcrypto_random_bytes

We can always get EINTR for read; /dev/urandom is no exception.

Rearrange the order of tests for likelihood; allow degenerate buflen==0
case to perform a no-op zero-length read.  This means that the normal
success path is a straight line with a single test for success.

Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
crypto/random-platform.c