mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-06 07:58:44 +02:00
Fix poll able streams for Darwin (and probably BSD)
Darwin's poll doesn't change revents if there are no available events, though it returns 0. Initialize the fd.revents to 0 so that the test passes. That reveals a test failure, though, because with socket streams it takes time for an event to pass through the socket. Provide an 80-usec delay to allow time for the propagation.
This commit is contained in:
@@ -70,6 +70,9 @@ write_callback (gpointer user_data)
|
||||
nwrote = g_output_stream_write (out, buf, 2, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert_cmpint (nwrote, ==, 2);
|
||||
/* Give the pipe a few ticks to propagate the write for sockets. On my
|
||||
* iMac i7, 40 works, 30 doesn't. */
|
||||
g_usleep (80L);
|
||||
|
||||
check_source_readability_callback (GINT_TO_POINTER (TRUE));
|
||||
|
||||
|
Reference in New Issue
Block a user