GRand: Check return value of fopen directly

This doesn't fix anything, it should just silence some static analysis
tools.
This commit is contained in:
Colin Walters 2012-06-21 15:44:16 -04:00
parent 01d8d43d0b
commit a8ddd52a45

View File

@ -217,10 +217,9 @@ g_rand_new (void)
do do
{ {
errno = 0;
dev_urandom = fopen("/dev/urandom", "rb"); dev_urandom = fopen("/dev/urandom", "rb");
} }
while G_UNLIKELY (errno == EINTR); while G_UNLIKELY (dev_urandom == NULL && errno == EINTR);
if (dev_urandom) if (dev_urandom)
{ {