From cec0fd3c95ef7e36178d07a5b8a8c82155b9c0d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20B=C3=B6ker?= Date: Wed, 7 Jan 2026 12:01:56 +0100 Subject: [PATCH] Make PTY tests more robust Let's just punt on the EOF vs EIO issue. --- test/test-spawn.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/test/test-spawn.c b/test/test-spawn.c index 386f91f94..7554d0cae 100644 --- a/test/test-spawn.c +++ b/test/test-spawn.c @@ -153,18 +153,10 @@ static void pty_on_read(uv_stream_t* tcp, ssize_t nread, const uv_buf_t* buf) { if (nread > 0) { output_used += nread; } else if (nread < 0) { -#if defined(_WIN32) || \ - defined(__APPLE__) || \ - defined(__DragonFly__) || \ - defined(__FreeBSD__) || \ - defined(__NetBSD__) || \ - defined(__OpenBSD__) - ASSERT_EQ(nread, UV_EOF); -#elif defined(__ANDROID__) +/* Depending on the platform we either get UV_EOF or UV_EIO as the stream + * close indicator. Windows and BSDs do EOF, Linux does EIO, Android does both. + */ ASSERT(nread == UV_EIO || nread == UV_EOF); -#else - ASSERT_EQ(nread, UV_EIO); -#endif uv_close((uv_handle_t*) tcp, close_cb); } }