gunixoutputstream: add missing can_poll() implementation
authorDan Winship <danw@gnome.org>
Tue, 12 Jun 2012 11:08:26 +0000 (07:08 -0400)
committerDan Winship <danw@gnome.org>
Tue, 12 Jun 2012 11:08:26 +0000 (07:08 -0400)
https://bugzilla.gnome.org/show_bug.cgi?id=677770

gio/gunixoutputstream.c

index abd14a4..4e00dcb 100644 (file)
@@ -104,6 +104,7 @@ static gboolean g_unix_output_stream_close_finish (GOutputStream        *stream,
                                                   GAsyncResult         *result,
                                                   GError              **error);
 
+static gboolean g_unix_output_stream_pollable_can_poll      (GPollableOutputStream *stream);
 static gboolean g_unix_output_stream_pollable_is_writable   (GPollableOutputStream *stream);
 static GSource *g_unix_output_stream_pollable_create_source (GPollableOutputStream *stream,
                                                             GCancellable         *cancellable);
@@ -165,6 +166,7 @@ g_unix_output_stream_class_init (GUnixOutputStreamClass *klass)
 static void
 g_unix_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface)
 {
+  iface->can_poll = g_unix_output_stream_pollable_can_poll;
   iface->is_writable = g_unix_output_stream_pollable_is_writable;
   iface->create_source = g_unix_output_stream_pollable_create_source;
 }
@@ -516,6 +518,12 @@ g_unix_output_stream_close_finish (GOutputStream  *stream,
 }
 
 static gboolean
+g_unix_output_stream_pollable_can_poll (GPollableOutputStream *stream)
+{
+  return G_UNIX_OUTPUT_STREAM (stream)->priv->is_pipe_or_socket;
+}
+
+static gboolean
 g_unix_output_stream_pollable_is_writable (GPollableOutputStream *stream)
 {
   GUnixOutputStream *unix_stream = G_UNIX_OUTPUT_STREAM (stream);