mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-15 07:43:50 +00:00
Added pid check for forkpty() initialization
This commit is contained in:
@@ -955,13 +955,16 @@ ILibProcessPipe_Process ILibProcessPipe_Manager_SpawnProcessEx4(ILibProcessPipe_
|
|||||||
|
|
||||||
|
|
||||||
pid = forkpty(&pipe, NULL, flags == 0 ? NULL : &tios, &w);
|
pid = forkpty(&pipe, NULL, flags == 0 ? NULL : &tios, &w);
|
||||||
retVal->PTY = pipe;
|
if (pid > 0)
|
||||||
retVal->stdIn = ILibProcessPipe_Pipe_CreateFromExistingWithExtraMemory(pipeManager, pipe, extraMemorySize);
|
{
|
||||||
retVal->stdOut = ILibProcessPipe_Pipe_CreateFromExistingWithExtraMemory(pipeManager, pipe, extraMemorySize);
|
retVal->PTY = pipe;
|
||||||
|
retVal->stdIn = ILibProcessPipe_Pipe_CreateFromExistingWithExtraMemory(pipeManager, pipe, extraMemorySize);
|
||||||
|
retVal->stdOut = ILibProcessPipe_Pipe_CreateFromExistingWithExtraMemory(pipeManager, pipe, extraMemorySize);
|
||||||
|
|
||||||
retVal->stdIn->mProcess = retVal;
|
retVal->stdIn->mProcess = retVal;
|
||||||
ILibProcessPipe_Pipe_SetBrokenPipeHandler(retVal->stdOut, ILibProcessPipe_Process_BrokenPipeSink);
|
ILibProcessPipe_Pipe_SetBrokenPipeHandler(retVal->stdOut, ILibProcessPipe_Process_BrokenPipeSink);
|
||||||
retVal->stdOut->mProcess = retVal;
|
retVal->stdOut->mProcess = retVal;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user