[*] Fix linux build warning and not quite complete linux ipc fix a4f6db7ec9

This commit is contained in:
Reece Wilson 2023-09-17 18:36:20 +01:00
parent ff0e32ce02
commit a96788623f
2 changed files with 11 additions and 5 deletions

View File

@ -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;
}

View File

@ -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();