mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-06 16:08:43 +02:00
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
This commit is contained in:
@@ -18,6 +18,10 @@
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
|
||||
#error "Only <gio/gio.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __G_POLLABLE_OUTPUT_STREAM_H__
|
||||
#define __G_POLLABLE_OUTPUT_STREAM_H__
|
||||
|
||||
@@ -73,7 +77,7 @@ struct _GPollableOutputStreamInterface
|
||||
GCancellable *cancellable);
|
||||
gssize (*write_nonblocking) (GPollableOutputStream *stream,
|
||||
const void *buffer,
|
||||
gsize size,
|
||||
gsize count,
|
||||
GError **error);
|
||||
};
|
||||
|
||||
@@ -87,7 +91,7 @@ GSource *g_pollable_output_stream_create_source (GPollableOutputStream *str
|
||||
|
||||
gssize g_pollable_output_stream_write_nonblocking (GPollableOutputStream *stream,
|
||||
const void *buffer,
|
||||
gsize size,
|
||||
gsize count,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
|
Reference in New Issue
Block a user