Don't repeat a failed fclose() call, since that invokes undefined

2006-04-26  Matthias Clasen  <mclasen@redhat.com>

	* glib/grand.c (g_rand_new): Don't repeat a failed fclose()
	call, since that invokes undefined behaviour.  (Coverity)
This commit is contained in:
Matthias Clasen
2006-04-26 04:19:48 +00:00
committed by Matthias Clasen
parent d4ac791e02
commit b8b28a7206
3 changed files with 11 additions and 6 deletions

View File

@@ -191,12 +191,7 @@ g_rand_new (void)
if (r != 1)
dev_urandom_exists = FALSE;
do
{
errno = 0;
fclose (dev_urandom);
}
while G_UNLIKELY (errno == EINTR);
fclose (dev_urandom);
}
else
dev_urandom_exists = FALSE;