systemclock: Only retry writing to the socket for EAGAIN, EWOULDBLOCK and EINTR

Fixes infinite loop in some cases, bug #650002.
This commit is contained in:
Sebastian Dröge 2011-05-12 15:51:22 +02:00
parent 9149043e95
commit cdffc1d5d5

View file

@ -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++;