diff options
| author | ncelikNV <ncelik@nvidia.com> | 2025-10-08 21:20:16 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-08 18:20:16 +0000 |
| commit | d30ae275e5ff53650526755ffa2a7a42992d88a8 (patch) | |
| tree | 0b0ddd0fa45971bc2c4d67c67389d4f8d1468dac /source | |
| parent | 4b3fd0a4536f873649e6fcdefbaf2f8b6f0897e0 (diff) | |
Fix UnixPipeStream::read() not handling EOF (#8626)
Fixes #6754.
Diffstat (limited to 'source')
| -rw-r--r-- | source/core/unix/slang-unix-process.cpp | 11 |
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; } |
