From a8ddd52a45ccf1e9a6aa6b5d873e12eda3a205df Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 21 Jun 2012 15:44:16 -0400 Subject: [PATCH] GRand: Check return value of fopen directly This doesn't fix anything, it should just silence some static analysis tools. --- glib/grand.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/glib/grand.c b/glib/grand.c index 040562869..4d6a0a621 100644 --- a/glib/grand.c +++ b/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) {