gunixoutputstream: add missing can_poll() implementation

https://bugzilla.gnome.org/show_bug.cgi?id=677770
This commit is contained in:
Dan Winship 2012-06-12 07:08:26 -04:00
parent b9ec5699cd
commit 14eb3d3590

View File

@ -104,6 +104,7 @@ static gboolean g_unix_output_stream_close_finish (GOutputStream *stream,
GAsyncResult *result, GAsyncResult *result,
GError **error); 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 gboolean g_unix_output_stream_pollable_is_writable (GPollableOutputStream *stream);
static GSource *g_unix_output_stream_pollable_create_source (GPollableOutputStream *stream, static GSource *g_unix_output_stream_pollable_create_source (GPollableOutputStream *stream,
GCancellable *cancellable); GCancellable *cancellable);
@ -165,6 +166,7 @@ g_unix_output_stream_class_init (GUnixOutputStreamClass *klass)
static void static void
g_unix_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface) 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->is_writable = g_unix_output_stream_pollable_is_writable;
iface->create_source = g_unix_output_stream_pollable_create_source; iface->create_source = g_unix_output_stream_pollable_create_source;
} }
@ -515,6 +517,12 @@ g_unix_output_stream_close_finish (GOutputStream *stream,
return TRUE; return TRUE;
} }
static gboolean
g_unix_output_stream_pollable_can_poll (GPollableOutputStream *stream)
{
return G_UNIX_OUTPUT_STREAM (stream)->priv->is_pipe_or_socket;
}
static gboolean static gboolean
g_unix_output_stream_pollable_is_writable (GPollableOutputStream *stream) g_unix_output_stream_pollable_is_writable (GPollableOutputStream *stream)
{ {