summaryrefslogtreecommitdiffstats
path: root/source/core
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2022-02-10 19:35:11 -0500
committerGitHub <noreply@github.com>2022-02-10 19:35:11 -0500
commit3f86ebf1ed4908ad0735a190b239e3f3bcbf4cef (patch)
tree0b8c9f26f5a2c86d4306c6e6a582afaf33b5a948 /source/core
parent1c030cdb964979bb0837a297749236a541cc80fa (diff)
OSX CI Test (#2126)
* #include an absolute path didn't work - because paths were taken to always be relative. * Small fixes. Added compiler crash with generic defined in a function. Added enum-flags test that works (by limiting backing type to int), and using __EnumType constraint. * Add comment about crash. * Disable crashing test. * Fixes to make compile on OSX. * Add github build for OSX. * Make premake generator a utility. * Fix osx compilation issue. * More fixes for OSX build. * OSX fix due to ambiguity around size_t and integer types. * Disable xlib on build on osx. * Use 'prebuildcommands' to make prebuild make utility projects do something. * Small fixes for premake so utility works on linux/osx. * Another hack to try and make generators run when 'utility' * Fix typo in macos.yml. * Revert premake to old style, and disable stdlib embedding on OSX. * OSX testing. * Fix pipe handling for OSX. * Enable testing on OSX. * Small fix because uname -p is not x64 on darwin.
Diffstat (limited to 'source/core')
-rw-r--r--source/core/unix/slang-unix-process.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/source/core/unix/slang-unix-process.cpp b/source/core/unix/slang-unix-process.cpp
index 991d905d9..2275238d9 100644
--- a/source/core/unix/slang-unix-process.cpp
+++ b/source/core/unix/slang-unix-process.cpp
@@ -261,6 +261,12 @@ SlangResult UnixPipeStream::read(void* buffer, size_t length, size_t& outReadByt
return SLANG_FAIL;
}
+ // If there are no poll events, we are done
+ if (pollResult == 0)
+ {
+ return SLANG_OK;
+ }
+
// If there is data read that first
if (pollInfo.revents & POLLIN)
{
@@ -281,7 +287,16 @@ SlangResult UnixPipeStream::read(void* buffer, size_t length, size_t& outReadByt
}
outReadBytes = size_t(count);
- return SLANG_OK;
+
+ // If no bytes were wanted, then there could still be bytes in the pipe
+ // before a HUP. So don't fall through to check for HUP.
+ //
+ // If some bytes *were* wanted and none were read, we can allow fall through to
+ // handle HUP.
+ if (length == 0 || count > 0)
+ {
+ return SLANG_OK;
+ }
}
if (pollInfo.revents & POLLHUP)