GUnixInput/OutputStream: fix blocking methods to always block
authorDan Winship <danw@gnome.org>
Mon, 14 Nov 2011 23:27:34 +0000 (18:27 -0500)
committerDan Winship <danw@gnome.org>
Mon, 14 Nov 2011 23:31:21 +0000 (18:31 -0500)
commit74dad004d143a2d3fbe4171d20e57cc9942ad89d
tree60df9687310d5f9a8d76d31d121215c2149bec83
parent29f786851d9fb8c8229161087e55254e379ef6e7
GUnixInput/OutputStream: fix blocking methods to always block

Previously, if you created a GUnixInputStream or GUnixOutputStream
from a non-blocking file descriptor, it might sometimes return
G_IO_ERROR_WOULD_BLOCK from g_input_stream_read/g_output_stream_write,
which is wrong. Fix that. (Use the GPollableInput/OutputStream methods
if you want non-blocking I/O.)

Also, add a test for this to gio/tests/unix-streams.

Also, fix the GError messages to say "Error reading from file
descriptor", etc instead of "Error reading from unix" (which was
presumably from a bad search and replace job).

https://bugzilla.gnome.org/show_bug.cgi?id=626866
gio/gunixinputstream.c
gio/gunixoutputstream.c
gio/tests/unix-streams.c