From 7e95777a6a46ef40b1a175e95136942b4eed4d75 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Sun, 1 Apr 2012 14:47:19 -0400 Subject: gio: minor GPollableInputStream / GPollableOutputStream fixes Make g_pollable_input_stream_read() and g_pollable_output_stream_write() look a little bit more like the non-pollable versions in terms of error handling, etc. Also, use the read_fn and write_fn virtual methods directly rather than calling g_input_stream_read()/g_output_stream_write(), to avoid problems with re-entrancy involving the "pending" flag. Also belatedly add single-include guards to the header files. https://bugzilla.gnome.org/show_bug.cgi?id=673997 --- gio/gpollableinputstream.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'gio/gpollableinputstream.h') diff --git a/gio/gpollableinputstream.h b/gio/gpollableinputstream.h index 3b57460fd..634ff2aeb 100644 --- a/gio/gpollableinputstream.h +++ b/gio/gpollableinputstream.h @@ -18,6 +18,10 @@ * Boston, MA 02111-1307, USA. */ +#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __G_POLLABLE_INPUT_STREAM_H__ #define __G_POLLABLE_INPUT_STREAM_H__ @@ -73,7 +77,7 @@ struct _GPollableInputStreamInterface GCancellable *cancellable); gssize (*read_nonblocking) (GPollableInputStream *stream, void *buffer, - gsize size, + gsize count, GError **error); }; @@ -87,7 +91,7 @@ GSource *g_pollable_input_stream_create_source (GPollableInputStream *stream gssize g_pollable_input_stream_read_nonblocking (GPollableInputStream *stream, void *buffer, - gsize size, + gsize count, GCancellable *cancellable, GError **error); -- cgit v1.2.1