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 <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
John Barboza 2017-08-16 20:36:34 -04:00 committed by Santiago Gimeno
parent cbac5f1693
commit 607dc073eb
No known key found for this signature in database
GPG Key ID: F28C3C8DA33C03BE

View File

@ -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
}