diff --git a/Source/IO/IPC/AuIPCPipe.Unix.cpp b/Source/IO/IPC/AuIPCPipe.Unix.cpp index 181b3a00..a653e1f3 100644 --- a/Source/IO/IPC/AuIPCPipe.Unix.cpp +++ b/Source/IO/IPC/AuIPCPipe.Unix.cpp @@ -63,7 +63,7 @@ namespace Aurora::IO::IPC #if defined(FIONREAD) int available {}; - if (::ioctl(fds[1], FIONREAD, &available) < 0) + if (::ioctl(this->secondary[0], FIONREAD, &available) < 0) { return; } @@ -75,7 +75,7 @@ namespace Aurora::IO::IPC AuByteBuffer temp(available); SysAssert(temp); - + AuUInt uCounter {}; while (this->ReadEx({temp, uCounter}, true, false)) { @@ -199,10 +199,16 @@ namespace Aurora::IO::IPC bool IPCPipeImpl::ReadEx(const Memory::MemoryViewStreamWrite &write, bool nonblock, bool bSide) { - auto handle = bSide ? fds[0] : fds[1]; + auto handle = bSide ? this->fds[0] : this->secondary[0]; + auto control = ::fcntl(handle, F_GETFL); auto ref = control; + if (control < 0) + { + return false; + } + if (nonblock) { control |= O_NONBLOCK; @@ -221,7 +227,7 @@ namespace Aurora::IO::IPC { #if defined(FIONREAD) int available {}; - if (::ioctl(fds[0], FIONREAD, &available) < 0) + if (::ioctl(handle, FIONREAD, &available) < 0) { return false; } diff --git a/Source/Threading/Primitives/AuMutex.Linux.hpp b/Source/Threading/Primitives/AuMutex.Linux.hpp index f8fb2ba5..9247ea76 100755 --- a/Source/Threading/Primitives/AuMutex.Linux.hpp +++ b/Source/Threading/Primitives/AuMutex.Linux.hpp @@ -20,7 +20,7 @@ namespace Aurora::Threading::Primitives void SlowLock() override; bool LockMS(AuUInt64 timeout) override; bool LockNS(AuUInt64 timeout) override; - bool LockAbsNS(AuUInt64 uTimeout); + bool LockAbsNS(AuUInt64 uTimeout) override; void Unlock() override; auline bool TryLockNoSpin();