Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx> --- src/util/virrandom.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/util/virrandom.c b/src/util/virrandom.c index 9597640840..ea55fe654d 100644 --- a/src/util/virrandom.c +++ b/src/util/virrandom.c @@ -182,9 +182,7 @@ virRandomBytes(unsigned char *buf, while (buflen > 0) { ssize_t n; - if ((n = read(fd, buf, buflen)) <= 0) { - if (errno == EINTR) - continue; + if ((n = saferead(fd, buf, buflen)) <= 0) { VIR_FORCE_CLOSE(fd); return n < 0 ? -errno : -ENODATA; } -- 2.16.1 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list