From 566a2e6828bb5d6ea3a35e24938675a296bbe95b Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 8 Mar 2013 13:44:08 -0800 Subject: Fix tevent testsuite issue on Solaris. On Solaris/Nexenta/Illumos once a pipe is full it will not be reported as writable until PIPE_BUF (actually on Solaris 4096, which is less than PIPE_BUF) bytes have been read from it. Signed-off-by: Jeremy Allison Reviewed-by: Michael Adam Autobuild-User(master): Michael Adam Autobuild-Date(master): Fri Mar 22 18:16:45 CET 2013 on sn-devel-104 --- lib/tevent/testsuite.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/tevent') diff --git a/lib/tevent/testsuite.c b/lib/tevent/testsuite.c index 1fcfa1cac3..7851c6c92d 100644 --- a/lib/tevent/testsuite.c +++ b/lib/tevent/testsuite.c @@ -482,8 +482,13 @@ static void test_event_fd2_sock_handler(struct tevent_context *ev_ctx, return; } - if (oth_sock->num_read > 0) { + if (oth_sock->num_read >= PIPE_BUF) { /* + * On Linux we become writable once we've read + * one byte. On Solaris we only become writable + * again once we've read 4096 bytes. PIPE_BUF + * is probably a safe bet to test against. + * * There should be room to write a byte again */ if (!(flags & TEVENT_FD_WRITE)) { -- cgit