From: Matthias Clasen Date: Wed, 26 Apr 2006 04:19:48 +0000 (+0000) Subject: Don't repeat a failed fclose() call, since that invokes undefined X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=b8b28a720660796bdc5b9734df7524555a655f3b;p=dana%2Fcg-glib.git Don't repeat a failed fclose() call, since that invokes undefined 2006-04-26 Matthias Clasen * glib/grand.c (g_rand_new): Don't repeat a failed fclose() call, since that invokes undefined behaviour. (Coverity) --- diff --git a/ChangeLog b/ChangeLog index 052ba35a..c8955ba6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-04-26 Matthias Clasen + + * glib/grand.c (g_rand_new): Don't repeat a failed fclose() + call, since that invokes undefined behaviour. (Coverity) + 2006-04-25 Matthias Clasen * glib/gbookmarkfile.c (is_element_full): Avoid a possible diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 052ba35a..c8955ba6 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,8 @@ +2006-04-26 Matthias Clasen + + * glib/grand.c (g_rand_new): Don't repeat a failed fclose() + call, since that invokes undefined behaviour. (Coverity) + 2006-04-25 Matthias Clasen * glib/gbookmarkfile.c (is_element_full): Avoid a possible diff --git a/glib/grand.c b/glib/grand.c index b1f809e6..68274f95 100644 --- a/glib/grand.c +++ b/glib/grand.c @@ -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;