Commit a90adcca authored by Tim-Philipp Müller's avatar Tim-Philipp Müller

multifdsink: do check return values of fcntl() and fstat()

https://bugzilla.gnome.org/show_bug.cgi?id=647294
parent bf2b14f8
......@@ -876,7 +876,11 @@ gst_multi_fd_sink_add_full (GstMultiFdSink * sink, int fd,
sink->clients_cookie++;
/* set the socket to non blocking */
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);
......@@ -888,8 +892,7 @@ gst_multi_fd_sink_add_full (GstMultiFdSink * sink, int fd,
}
}
/* figure out the mode, can't use send() for non sockets */
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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment