From 607dc073eb293f9d193b3491071b00e815d1df76 Mon Sep 17 00:00:00 2001 From: John Barboza Date: Wed, 16 Aug 2017 20:36:34 -0400 Subject: [PATCH] zos, test: flush out the oob data in callback Need to flush out the OOB data. Otherwise, this callback will get triggered on every poll with nread = 0. PR-URL: https://github.com/libuv/libuv/pull/1484 Reviewed-By: Santiago Gimeno Reviewed-By: Colin Ihrig Reviewed-By: Ben Noordhuis --- test/test-tcp-oob.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/test-tcp-oob.c b/test/test-tcp-oob.c index fc011ee4..4f1397a8 100644 --- a/test/test-tcp-oob.c +++ b/test/test-tcp-oob.c @@ -56,8 +56,21 @@ static void idle_cb(uv_idle_t* idle) { static void read_cb(uv_stream_t* handle, ssize_t nread, const uv_buf_t* buf) { +#ifdef __MVS__ + char lbuf[12]; +#endif + uv_os_fd_t fd; + ASSERT(nread > 0); + ASSERT(0 == uv_fileno((uv_handle_t*)handle, &fd)); ASSERT(0 == uv_idle_start(&idle, idle_cb)); + +#ifdef __MVS__ + /* Need to flush out the OOB data. Otherwise, this callback will get + * triggered on every poll with nread = 0. + */ + ASSERT(-1 != recv(fd, lbuf, sizeof(lbuf), MSG_OOB)); +#endif }