Commit 92e7a4f3 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

Fix usage of nanosleep(). (#163039, Bastien Nocera)

2005-02-20  Matthias Clasen  <mclasen@redhat.com>

	* glib/gtimer.c (g_usleep): Fix usage of
	nanosleep().  (#163039, Bastien Nocera)
parent 0def8772
2005-02-20 Matthias Clasen <mclasen@redhat.com>
* glib/gtimer.c (g_usleep): Fix usage of
nanosleep(). (#163039, Bastien Nocera)
2005-02-16 Adi Attar <aattar@cvs.gnome.org>
* configure.in: Added "xh" to ALL_LINGUAS.
......
2005-02-20 Matthias Clasen <mclasen@redhat.com>
* glib/gtimer.c (g_usleep): Fix usage of
nanosleep(). (#163039, Bastien Nocera)
2005-02-16 Adi Attar <aattar@cvs.gnome.org>
* configure.in: Added "xh" to ALL_LINGUAS.
......
2005-02-20 Matthias Clasen <mclasen@redhat.com>
* glib/gtimer.c (g_usleep): Fix usage of
nanosleep(). (#163039, Bastien Nocera)
2005-02-16 Adi Attar <aattar@cvs.gnome.org>
* configure.in: Added "xh" to ALL_LINGUAS.
......
2005-02-20 Matthias Clasen <mclasen@redhat.com>
* glib/gtimer.c (g_usleep): Fix usage of
nanosleep(). (#163039, Bastien Nocera)
2005-02-16 Adi Attar <aattar@cvs.gnome.org>
* configure.in: Added "xh" to ALL_LINGUAS.
......
......@@ -240,8 +240,18 @@ 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 (nanosleep (&request, &remaining) == EINTR)
request = remaining;
while (1)
{
if (nanosleep (&request, &remaining) == -1)
{
if (errno == EINTR)
request = remaining;
else
break;
}
else
break;
}
# else /* !HAVE_NANOSLEEP */
if (g_thread_supported ())
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment