[*] Linux fixes

This commit is contained in:
Reece Wilson 2023-09-23 08:15:50 +01:00
parent 828430889c
commit c05fabc633
2 changed files with 9 additions and 5 deletions

View File

@ -109,7 +109,7 @@ namespace Aurora::IO::FS
}
int fd = (int)opt.ValueOr((int)-1);
if (opt == -1)
if (fd == -1)
{
SysPushErrorIOResourceRejected();
return false;
@ -155,7 +155,7 @@ namespace Aurora::IO::FS
}
int fd = (int)opt.ValueOr((int)-1);
if (opt == -1)
if (fd == -1)
{
SysPushErrorIOResourceRejected();
return false;

View File

@ -624,21 +624,25 @@ namespace Aurora::Processes
if (pid == 0)
{
this->ForkMain();
SysPanic();
return false;
}
else if (pid > 0)
{
if (pipeStdOut_[1])
if (pipeStdOut_[1] &&
pipeStdOut_[1] != -1)
{
::close(AuExchange(pipeStdOut_[1], 0));
}
if (pipeStdErr_[1])
if (pipeStdErr_[1] &&
pipeStdErr_[1] != -1)
{
::close(AuExchange(pipeStdErr_[1], 0));
}
if (pipeStdIn_[0])
if (pipeStdIn_[0] &&
pipeStdIn_[0] != -1)
{
::close(AuExchange(pipeStdIn_[0], 0));
}