GstTCPClient *client;
GList *clink;
GTimeVal now;
- gint flags, res;
+ gint flags;
struct stat statbuf;
GST_DEBUG_OBJECT (sink, "[fd %5d] adding client, sync_method %d, "
sink->clients_cookie++;
/* set the socket to non blocking */
- res = fcntl (fd, F_SETFL, O_NONBLOCK);
+ if (fcntl (fd, F_SETFL, O_NONBLOCK) < 0) {
+ GST_ERROR_OBJECT (sink, "failed to make socket %d non-blocking: %s", fd,
+ g_strerror (errno));
+ }
+
/* we always read from a client */
gst_poll_add_fd (sink->fdset, &client->fd);
}
}
/* figure out the mode, can't use send() for non sockets */
- res = fstat (fd, &statbuf);
- if (S_ISSOCK (statbuf.st_mode)) {
+ if (fstat (fd, &statbuf) == 0 && S_ISSOCK (statbuf.st_mode)) {
client->is_socket = TRUE;
setup_dscp_client (sink, client);
}
}
case GST_SYNC_METHOD_BURST_KEYFRAME:
{
- gboolean ok;
gint min_idx, max_idx;
gint next_syncframe, prev_syncframe;
* NEXT_KEYFRAME.
*/
/* gather burst limits */
- ok = count_burst_unit (sink, &min_idx, client->burst_min_unit,
+ count_burst_unit (sink, &min_idx, client->burst_min_unit,
client->burst_min_value, &max_idx, client->burst_max_unit,
client->burst_max_value);
}
case GST_SYNC_METHOD_BURST_WITH_KEYFRAME:
{
- gboolean ok;
gint min_idx, max_idx;
gint next_syncframe;
* amount of data up 'till min.
*/
/* gather enough data to burst */
- ok = count_burst_unit (sink, &min_idx, client->burst_min_unit,
+ count_burst_unit (sink, &min_idx, client->burst_min_unit,
client->burst_min_value, &max_idx, client->burst_max_unit,
client->burst_max_value);