Minor updates:
- CSelectableCore: - Allow ForkPipeHandle to change ExecPath - Remove parent/child process test comments - Move FD operations methods from private -> public
This commit is contained in:
@@ -183,7 +183,7 @@ bool CSelectableCore::SetPortHandle( THandle * Handle, const char * FileName )
|
||||
bool CSelectableCore::SetForkPipeHandle( THandle * Handle, const char * ExecPath )
|
||||
{
|
||||
// Validate
|
||||
if (!Handle || (Handle->Type != ctNone) || !ExecPath) {
|
||||
if (!Handle || ((Handle->Type != ctNone) && (Handle->Type != ctForkPipe)) || !ExecPath) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -405,16 +405,12 @@ int CSelectableCore::OpenForkPipe( THandle * Handle )
|
||||
close( pipefd[0] );
|
||||
Handle->FD = pipefd[1];
|
||||
|
||||
write( Handle->FD, "testing\n", 8 );
|
||||
|
||||
// Log event
|
||||
if (Log) Log->Message( DebugLevel, dlMedium, "%s: Handle '%s' - Process forked successfully", Name, Handle->Name );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Fork success - this is child
|
||||
printf( "child\n" );
|
||||
|
||||
// Replace stdin with Read-end of pipe
|
||||
close( 0 );
|
||||
dup( pipefd[0] );
|
||||
|
||||
Reference in New Issue
Block a user