Handle EINTR in open and dup calls in urandom.c.

Per review comment in
https://boringssl-review.googlesource.com/#/c/5302/7/crypto/rand/urandom.c

Change-Id: I9c279524a452cb97c60354213cbc6e2aeabe0bfa
Reviewed-on: https://boringssl-review.googlesource.com/5311
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/crypto/rand/urandom.c b/crypto/rand/urandom.c
index 397ded9..d7ed5c6 100644
--- a/crypto/rand/urandom.c
+++ b/crypto/rand/urandom.c
@@ -96,7 +96,9 @@
     return urandom_fd;
   }
 
-  urandom_fd = open("/dev/urandom", O_RDONLY);
+  do {
+    urandom_fd = open("/dev/urandom", O_RDONLY);
+  } while (urandom_fd == -1 && errno == EINTR);
   return urandom_fd;
 }
 
@@ -124,7 +126,9 @@
     /* |RAND_set_urandom_fd| may not be called after the RNG is used. */
     abort();
   }
-  urandom_fd = dup(fd);
+  do {
+    urandom_fd = dup(fd);
+  } while (urandom_fd == -1 && errno == EINTR);
   if (urandom_fd < 0) {
     abort();
   }