From 36a858614710c4ede10f9ca1a765bcb8577e258c Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Thu, 19 Sep 2019 10:10:07 +0200 Subject: [PATCH] Retry getrandom() on EINTR --- pdns/dns_random.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pdns/dns_random.cc b/pdns/dns_random.cc index c2b707d10..5618e1390 100644 --- a/pdns/dns_random.cc +++ b/pdns/dns_random.cc @@ -151,7 +151,7 @@ static void dns_random_setup(bool force=false) char buf[1]; // some systems define getrandom but it does not really work, e.g. because it's // not present in kernel. - if (getrandom(buf, sizeof(buf), 0) == -1) { + if (getrandom(buf, sizeof(buf), 0) == -1 && errno != EINTR) { g_log<