From ea28f59fc1bb7d16f7e39ac260a6364ffc7f2e52 Mon Sep 17 00:00:00 2001 From: Manish Singh Date: Wed, 23 Feb 2005 02:33:54 +0000 Subject: [PATCH] Simplify the loop for the fix below. Tue Feb 22 18:33:07 2005 Manish Singh * glib/gtimer.c (g_usleep): Simplify the loop for the fix below. --- ChangeLog | 4 ++++ ChangeLog.pre-2-10 | 4 ++++ ChangeLog.pre-2-12 | 4 ++++ ChangeLog.pre-2-8 | 4 ++++ glib/gtimer.c | 14 ++------------ 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9987d0cc4..4a148ff4b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue Feb 22 18:33:07 2005 Manish Singh + + * glib/gtimer.c (g_usleep): Simplify the loop for the fix below. + 2005-02-20 Matthias Clasen * glib/gqueue.c (g_queue_new): Use a memchunk for diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 9987d0cc4..4a148ff4b 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,7 @@ +Tue Feb 22 18:33:07 2005 Manish Singh + + * glib/gtimer.c (g_usleep): Simplify the loop for the fix below. + 2005-02-20 Matthias Clasen * glib/gqueue.c (g_queue_new): Use a memchunk for diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 9987d0cc4..4a148ff4b 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,7 @@ +Tue Feb 22 18:33:07 2005 Manish Singh + + * glib/gtimer.c (g_usleep): Simplify the loop for the fix below. + 2005-02-20 Matthias Clasen * glib/gqueue.c (g_queue_new): Use a memchunk for diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 9987d0cc4..4a148ff4b 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,7 @@ +Tue Feb 22 18:33:07 2005 Manish Singh + + * glib/gtimer.c (g_usleep): Simplify the loop for the fix below. + 2005-02-20 Matthias Clasen * glib/gqueue.c (g_queue_new): Use a memchunk for diff --git a/glib/gtimer.c b/glib/gtimer.c index 0a660f79a..a30dc1944 100644 --- a/glib/gtimer.c +++ b/glib/gtimer.c @@ -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 ()) {