From e6921e98649766d059849da14084db34471b19c8 Mon Sep 17 00:00:00 2001 From: Daniel Richard G Date: Wed, 17 Aug 2016 16:57:35 -0700 Subject: [PATCH] maint: port tests to z/OS errno behavior * tests/test-nonblocking-reader.h: * tests/test-nonblocking-writer.h: Accommodate z/OS errno code preferences. (I believe this should still be within spec; IBM is good at following the letter if not the spirit of such things.) --- ChangeLog | 7 +++++++ tests/test-nonblocking-reader.h | 2 +- tests/test-nonblocking-writer.h | 6 +++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 88276cc547..2b75f35eaa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2016-08-17 Daniel Richard G. + maint: port tests to z/OS errno behavior + * tests/test-nonblocking-reader.h: + * tests/test-nonblocking-writer.h: + Accommodate z/OS errno code preferences. (I believe this should + still be within spec; IBM is good at following the letter if not + the spirit of such things.) + maint: preprocessor changes to support z/OS * lib/alloca.in.h, lib/fnmatch.c, lib/get-rusage-as.c: * lib/glob.c, lib/math.in.h, lib/ptsname_r.c: diff --git a/tests/test-nonblocking-reader.h b/tests/test-nonblocking-reader.h index e912af2b8a..71d9599a6a 100644 --- a/tests/test-nonblocking-reader.h +++ b/tests/test-nonblocking-reader.h @@ -110,7 +110,7 @@ full_read_from_nonblocking_fd (size_t fd, void *buf, size_t count) ASSERT (spent_time < 0.5); if (ret < 0) { - ASSERT (saved_errno == EAGAIN); + ASSERT (saved_errno == EAGAIN || saved_errno == EWOULDBLOCK); usleep (SMALL_DELAY); } else diff --git a/tests/test-nonblocking-writer.h b/tests/test-nonblocking-writer.h index b39a65c8ac..0a387c947f 100644 --- a/tests/test-nonblocking-writer.h +++ b/tests/test-nonblocking-writer.h @@ -124,7 +124,7 @@ main_writer_loop (int test, size_t data_block_size, int fd, (long) ret, dbgstrerror (ret < 0, saved_errno)); if (ret < 0 && bytes_written >= data_block_size) { - ASSERT (saved_errno == EAGAIN); + ASSERT (saved_errno == EAGAIN || saved_errno == EWOULDBLOCK); ASSERT (spent_time < 0.5); break; } @@ -133,7 +133,7 @@ main_writer_loop (int test, size_t data_block_size, int fd, ASSERT (spent_time < 0.5); if (ret < 0) { - ASSERT (saved_errno == EAGAIN); + ASSERT (saved_errno == EAGAIN || saved_errno == EWOULDBLOCK); usleep (SMALL_DELAY); } else @@ -165,7 +165,7 @@ main_writer_loop (int test, size_t data_block_size, int fd, ASSERT (spent_time < 0.5); if (ret < 0) { - ASSERT (saved_errno == EAGAIN); + ASSERT (saved_errno == EAGAIN || saved_errno == EWOULDBLOCK); usleep (SMALL_DELAY); } else -- 2.39.5