Simplify the loop for the fix below.
authorManish Singh <yosh@gimp.org>
Wed, 23 Feb 2005 02:33:54 +0000 (02:33 +0000)
committerManish Singh <yosh@src.gnome.org>
Wed, 23 Feb 2005 02:33:54 +0000 (02:33 +0000)
Tue Feb 22 18:33:07 2005  Manish Singh  <yosh@gimp.org>

        * glib/gtimer.c (g_usleep): Simplify the loop for the fix below.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-8
glib/gtimer.c

index 9987d0c..4a148ff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Tue Feb 22 18:33:07 2005  Manish Singh  <yosh@gimp.org>
+
+       * glib/gtimer.c (g_usleep): Simplify the loop for the fix below.
+
 2005-02-20  Matthias Clasen  <mclasen@redhat.com>
 
        * glib/gqueue.c (g_queue_new): Use a memchunk for
index 9987d0c..4a148ff 100644 (file)
@@ -1,3 +1,7 @@
+Tue Feb 22 18:33:07 2005  Manish Singh  <yosh@gimp.org>
+
+       * glib/gtimer.c (g_usleep): Simplify the loop for the fix below.
+
 2005-02-20  Matthias Clasen  <mclasen@redhat.com>
 
        * glib/gqueue.c (g_queue_new): Use a memchunk for
index 9987d0c..4a148ff 100644 (file)
@@ -1,3 +1,7 @@
+Tue Feb 22 18:33:07 2005  Manish Singh  <yosh@gimp.org>
+
+       * glib/gtimer.c (g_usleep): Simplify the loop for the fix below.
+
 2005-02-20  Matthias Clasen  <mclasen@redhat.com>
 
        * glib/gqueue.c (g_queue_new): Use a memchunk for
index 9987d0c..4a148ff 100644 (file)
@@ -1,3 +1,7 @@
+Tue Feb 22 18:33:07 2005  Manish Singh  <yosh@gimp.org>
+
+       * glib/gtimer.c (g_usleep): Simplify the loop for the fix below.
+
 2005-02-20  Matthias Clasen  <mclasen@redhat.com>
 
        * glib/gqueue.c (g_queue_new): Use a memchunk for
index 0a660f7..a30dc19 100644 (file)
@@ -240,18 +240,8 @@ g_usleep (gulong microseconds)
   struct timespec request, remaining;
   request.tv_sec = microseconds / G_USEC_PER_SEC;
   request.tv_nsec = 1000 * (microseconds % G_USEC_PER_SEC);
-  while (1)
-    {
-      if (nanosleep (&request, &remaining) == -1)
-       {
-          if (errno == EINTR)
-           request = remaining;
-         else 
-           break;
-       } 
-      else 
-       break;
-    }
+  while (nanosleep (&request, &remaining) == -1 && errno == EINTR)
+    request = remaining;
 # else /* !HAVE_NANOSLEEP */
   if (g_thread_supported ())
     {