summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorncelikNV <ncelik@nvidia.com>2025-10-08 21:20:16 +0300
committerGitHub <noreply@github.com>2025-10-08 18:20:16 +0000
commitd30ae275e5ff53650526755ffa2a7a42992d88a8 (patch)
tree0b0ddd0fa45971bc2c4d67c67389d4f8d1468dac
parent4b3fd0a4536f873649e6fcdefbaf2f8b6f0897e0 (diff)
Fix UnixPipeStream::read() not handling EOF (#8626)
Fixes #6754.
-rw-r--r--source/core/unix/slang-unix-process.cpp11
1 files changed, 11 insertions, 0 deletions
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;
}