From: Sebastian Dröge Date: Thu, 12 May 2011 13:51:22 +0000 (+0200) Subject: systemclock: Only retry writing to the socket for EAGAIN, EWOULDBLOCK and EINTR X-Git-Tag: RELEASE-0.10.36~313 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cdffc1d5d561ae069a9ea430f6c414b3f88882cc;p=platform%2Fupstream%2Fgstreamer.git systemclock: Only retry writing to the socket for EAGAIN, EWOULDBLOCK and EINTR Fixes infinite loop in some cases, bug #650002. --- diff --git a/gst/gstsystemclock.c b/gst/gstsystemclock.c index 10ad4ed..daea190 100644 --- a/gst/gstsystemclock.c +++ b/gst/gstsystemclock.c @@ -326,9 +326,16 @@ gst_system_clock_add_wakeup (GstSystemClock * sysclock) if (sysclock->priv->wakeup_count == 0) { GST_CAT_DEBUG (GST_CAT_CLOCK, "writing control"); while (!gst_poll_write_control (sysclock->priv->timer)) { - g_warning - ("gstsystemclock: write control failed in wakeup_async, trying again : %d:%s\n", - errno, g_strerror (errno)); + if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) { + g_warning + ("gstsystemclock: write control failed in wakeup_async, trying again: %d:%s\n", + errno, g_strerror (errno)); + } else { + g_critical + ("gstsystemclock: write control failed in wakeup_async: %d:%s\n", + errno, g_strerror (errno)); + return; + } } } sysclock->priv->wakeup_count++;