diff --git a/gio/gunixinputstream.c b/gio/gunixinputstream.c index 3d5f93806..65a0dbdca 100644 --- a/gio/gunixinputstream.c +++ b/gio/gunixinputstream.c @@ -417,7 +417,8 @@ g_unix_input_stream_read (GInputStream *stream, break; } - g_cancellable_release_fd (cancellable); + if (nfds == 2) + g_cancellable_release_fd (cancellable); return res; } diff --git a/gio/gunixoutputstream.c b/gio/gunixoutputstream.c index 01c32591e..86f527777 100644 --- a/gio/gunixoutputstream.c +++ b/gio/gunixoutputstream.c @@ -403,7 +403,8 @@ g_unix_output_stream_write (GOutputStream *stream, break; } - g_cancellable_release_fd (cancellable); + if (nfds == 2) + g_cancellable_release_fd (cancellable); return res; }