Ensure Process::create is always checked as true before continue doing anything.

This commit is contained in:
Martín Lucas Golini
2025-05-12 19:07:27 -03:00
parent 306f88bb3a
commit c3faa293d3
3 changed files with 24 additions and 22 deletions

View File

@@ -3660,14 +3660,15 @@ void App::init( const LogLevel& logLevel, std::string file, const Float& pidelDe
{
std::string lldbPath;
Process p;
p.create( "xcrun -f lldb" );
p.readAllStdOut( lldbPath, Seconds( 5 ) );
int retCode = -1;
p.join( &retCode );
if ( retCode == 0 && !lldbPath.empty() ) {
String::trimInPlace( lldbPath, '\n' );
if ( std::find( paths.begin(), paths.end(), lldbPath ) == paths.end() )
paths.emplace_back( lldbPath );
if ( p.create( "xcrun -f lldb" ) ) {
p.readAllStdOut( lldbPath, Seconds( 5 ) );
int retCode = -1;
p.join( &retCode );
if ( retCode == 0 && !lldbPath.empty() ) {
String::trimInPlace( lldbPath, '\n' );
if ( std::find( paths.begin(), paths.end(), lldbPath ) == paths.end() )
paths.emplace_back( lldbPath );
}
}
}