From 388f0ec06945d132265ed62e5e6d8f1bcf1155ee Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 18 Nov 2013 21:37:06 +0100 Subject: [PATCH] poll: improve debug So that we can see the return values of functions in the log. --- gst/gstpoll.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/gst/gstpoll.c b/gst/gstpoll.c index 366f464..03c2a14 100644 --- a/gst/gstpoll.c +++ b/gst/gstpoll.c @@ -1000,8 +1000,6 @@ gst_poll_fd_has_closed (const GstPoll * set, GstPollFD * fd) g_return_val_if_fail (fd != NULL, FALSE); g_return_val_if_fail (fd->fd >= 0, FALSE); - GST_DEBUG ("%p: fd (fd:%d, idx:%d)", set, fd->fd, fd->idx); - g_mutex_lock (&((GstPoll *) set)->lock); idx = find_index (set->active_fds, fd); @@ -1018,9 +1016,10 @@ gst_poll_fd_has_closed (const GstPoll * set, GstPollFD * fd) } else { GST_WARNING ("%p: couldn't find fd !", set); } - g_mutex_unlock (&((GstPoll *) set)->lock); + GST_DEBUG ("%p: fd (fd:%d, idx:%d) %d", set, fd->fd, fd->idx, res); + return res; } @@ -1043,8 +1042,6 @@ gst_poll_fd_has_error (const GstPoll * set, GstPollFD * fd) g_return_val_if_fail (fd != NULL, FALSE); g_return_val_if_fail (fd->fd >= 0, FALSE); - GST_DEBUG ("%p: fd (fd:%d, idx:%d)", set, fd->fd, fd->idx); - g_mutex_lock (&((GstPoll *) set)->lock); idx = find_index (set->active_fds, fd); @@ -1065,9 +1062,10 @@ gst_poll_fd_has_error (const GstPoll * set, GstPollFD * fd) } else { GST_WARNING ("%p: couldn't find fd !", set); } - g_mutex_unlock (&((GstPoll *) set)->lock); + GST_DEBUG ("%p: fd (fd:%d, idx:%d) %d", set, fd->fd, fd->idx, res); + return res; } @@ -1077,8 +1075,6 @@ gst_poll_fd_can_read_unlocked (const GstPoll * set, GstPollFD * fd) gboolean res = FALSE; gint idx; - GST_DEBUG ("%p: fd (fd:%d, idx:%d)", set, fd->fd, fd->idx); - idx = find_index (set->active_fds, fd); if (idx >= 0) { #ifndef G_OS_WIN32 @@ -1093,6 +1089,7 @@ gst_poll_fd_can_read_unlocked (const GstPoll * set, GstPollFD * fd) } else { GST_WARNING ("%p: couldn't find fd !", set); } + GST_DEBUG ("%p: fd (fd:%d, idx:%d) %d", set, fd->fd, fd->idx, res); return res; } @@ -1143,8 +1140,6 @@ gst_poll_fd_can_write (const GstPoll * set, GstPollFD * fd) g_return_val_if_fail (fd != NULL, FALSE); g_return_val_if_fail (fd->fd >= 0, FALSE); - GST_DEBUG ("%p: fd (fd:%d, idx:%d)", set, fd->fd, fd->idx); - g_mutex_lock (&((GstPoll *) set)->lock); idx = find_index (set->active_fds, fd); @@ -1161,9 +1156,10 @@ gst_poll_fd_can_write (const GstPoll * set, GstPollFD * fd) } else { GST_WARNING ("%p: couldn't find fd !", set); } - g_mutex_unlock (&((GstPoll *) set)->lock); + GST_DEBUG ("%p: fd (fd:%d, idx:%d) %d", set, fd->fd, fd->idx, res); + return res; } -- 2.7.4