summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;
}