diff --git a/Source/IO/FS/FileAdvisory.Unix.cpp b/Source/IO/FS/FileAdvisory.Unix.cpp index c55c83d4..8cb0aa24 100644 --- a/Source/IO/FS/FileAdvisory.Unix.cpp +++ b/Source/IO/FS/FileAdvisory.Unix.cpp @@ -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; diff --git a/Source/Processes/AuProcess.Unix.cpp b/Source/Processes/AuProcess.Unix.cpp index 9d8ddd51..861c5899 100644 --- a/Source/Processes/AuProcess.Unix.cpp +++ b/Source/Processes/AuProcess.Unix.cpp @@ -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)); }