From 63ea8d18f39714734c45780c36441fbe572e4c81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 6 Nov 2018 15:16:41 +0200 Subject: [PATCH] Simplify some code in GUnixOutputStream --- gio/gunixoutputstream.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gio/gunixoutputstream.c b/gio/gunixoutputstream.c index 3a2350009..5536e00b4 100644 --- a/gio/gunixoutputstream.c +++ b/gio/gunixoutputstream.c @@ -339,19 +339,18 @@ g_unix_output_stream_write (GOutputStream *stream, GUnixOutputStream *unix_stream; gssize res = -1; GPollFD poll_fds[2]; - int nfds; + int nfds = 0; int poll_ret; unix_stream = G_UNIX_OUTPUT_STREAM (stream); poll_fds[0].fd = unix_stream->priv->fd; poll_fds[0].events = G_IO_OUT; + nfds++; if (unix_stream->priv->is_pipe_or_socket && g_cancellable_make_pollfd (cancellable, &poll_fds[1])) - nfds = 2; - else - nfds = 1; + nfds++; while (1) {