Simplify some code in GUnixOutputStream

This commit is contained in:
Sebastian Dröge 2018-11-06 15:16:41 +02:00
parent 90d9e4ab72
commit 63ea8d18f3

View File

@ -339,19 +339,18 @@ g_unix_output_stream_write (GOutputStream *stream,
GUnixOutputStream *unix_stream; GUnixOutputStream *unix_stream;
gssize res = -1; gssize res = -1;
GPollFD poll_fds[2]; GPollFD poll_fds[2];
int nfds; int nfds = 0;
int poll_ret; int poll_ret;
unix_stream = G_UNIX_OUTPUT_STREAM (stream); unix_stream = G_UNIX_OUTPUT_STREAM (stream);
poll_fds[0].fd = unix_stream->priv->fd; poll_fds[0].fd = unix_stream->priv->fd;
poll_fds[0].events = G_IO_OUT; poll_fds[0].events = G_IO_OUT;
nfds++;
if (unix_stream->priv->is_pipe_or_socket && if (unix_stream->priv->is_pipe_or_socket &&
g_cancellable_make_pollfd (cancellable, &poll_fds[1])) g_cancellable_make_pollfd (cancellable, &poll_fds[1]))
nfds = 2; nfds++;
else
nfds = 1;
while (1) while (1)
{ {