From d30ae275e5ff53650526755ffa2a7a42992d88a8 Mon Sep 17 00:00:00 2001 From: ncelikNV Date: Wed, 8 Oct 2025 21:20:16 +0300 Subject: Fix UnixPipeStream::read() not handling EOF (#8626) Fixes #6754. --- source/core/unix/slang-unix-process.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source/core') diff --git a/source/core/unix/slang-unix-process.cpp b/source/core/unix/slang-unix-process.cpp index 68c38236a..d1d0a3b5e 100644 --- a/source/core/unix/slang-unix-process.cpp +++ b/source/core/unix/slang-unix-process.cpp @@ -300,6 +300,12 @@ SlangResult UnixPipeStream::read(void* buffer, size_t length, size_t& outReadByt { return SLANG_OK; } + + // End of file. + if (count == 0) + { + close(); + } } if (pollInfo.revents & POLLHUP) @@ -307,6 +313,11 @@ SlangResult UnixPipeStream::read(void* buffer, size_t length, size_t& outReadByt close(); } + if (pollInfo.revents & POLLERR || pollInfo.revents & POLLNVAL) + { + return SLANG_FAIL; + } + return SLANG_OK; } -- cgit v1.2.3