mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-11 15:06:14 +01:00
Simplify some code in GUnixOutputStream
This commit is contained in:
parent
90d9e4ab72
commit
63ea8d18f3
@ -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)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user