dv1394: log error if failed to set socket status flag

Log an error message if failed to set write or read socket as
non-blocking.

CID 1139608
CID 1139609
This commit is contained in:
Luis de Bethencourt 2015-12-16 11:43:58 +00:00
parent 328346ad21
commit 2c54ea5ba9
2 changed files with 12 additions and 4 deletions

View file

@ -790,8 +790,12 @@ gst_dv1394src_start (GstBaseSrc * bsrc)
READ_SOCKET (src) = control_sock[0];
WRITE_SOCKET (src) = control_sock[1];
fcntl (READ_SOCKET (src), F_SETFL, O_NONBLOCK);
fcntl (WRITE_SOCKET (src), F_SETFL, O_NONBLOCK);
if (fcntl (READ_SOCKET (src), F_SETFL, O_NONBLOCK) < 0)
GST_ERROR_OBJECT (src, "failed to make read socket non-blocking: %s",
g_strerror (errno));
if (fcntl (WRITE_SOCKET (src), F_SETFL, O_NONBLOCK) < 0)
GST_ERROR_OBJECT (src, "failed to make write socket non-blocking: %s",
g_strerror (errno));
src->handle = raw1394_new_handle ();

View file

@ -527,8 +527,12 @@ gst_hdv1394src_start (GstBaseSrc * bsrc)
READ_SOCKET (src) = control_sock[0];
WRITE_SOCKET (src) = control_sock[1];
fcntl (READ_SOCKET (src), F_SETFL, O_NONBLOCK);
fcntl (WRITE_SOCKET (src), F_SETFL, O_NONBLOCK);
if (fcntl (READ_SOCKET (src), F_SETFL, O_NONBLOCK) < 0)
GST_ERROR_OBJECT (src, "failed to make read socket non-blocking: %s",
g_strerror (errno));
if (fcntl (WRITE_SOCKET (src), F_SETFL, O_NONBLOCK) < 0)
GST_ERROR_OBJECT (src, "failed to make write socket non-blocking: %s",
g_strerror (errno));
src->handle = raw1394_new_handle ();