summaryrefslogtreecommitdiff
path: root/glib/glib/grand.c
diff options
context:
space:
mode:
Diffstat (limited to 'glib/glib/grand.c')
-rw-r--r--glib/glib/grand.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/glib/glib/grand.c b/glib/glib/grand.c
index 0405628..4d6a0a6 100644
--- a/glib/glib/grand.c
+++ b/glib/glib/grand.c
@@ -216,11 +216,10 @@ g_rand_new (void)
FILE* dev_urandom;
do
- {
- errno = 0;
+ {
dev_urandom = fopen("/dev/urandom", "rb");
}
- while G_UNLIKELY (errno == EINTR);
+ while G_UNLIKELY (dev_urandom == NULL && errno == EINTR);
if (dev_urandom)
{