mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-03 04:10:05 -06:00
KWSys: Teach Process to error on empty command
Do not try to execute a child with no command line. Previously this led to a silent hang.
This commit is contained in:
@@ -720,6 +720,14 @@ void kwsysProcess_Execute(kwsysProcess* cp)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Make sure we have something to run. */
|
||||
if(cp->NumberOfCommands < 1)
|
||||
{
|
||||
strcpy(cp->ErrorMessage, "No command");
|
||||
cp->State = kwsysProcess_State_Error;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Initialize the control structure for a new process. */
|
||||
if(!kwsysProcessInitialize(cp))
|
||||
{
|
||||
|
||||
@@ -987,6 +987,14 @@ void kwsysProcess_Execute(kwsysProcess* cp)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Make sure we have something to run. */
|
||||
if(cp->NumberOfCommands < 1)
|
||||
{
|
||||
strcpy(cp->ErrorMessage, "No command");
|
||||
cp->State = kwsysProcess_State_Error;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Initialize the control structure for a new process. */
|
||||
if(!kwsysProcessInitialize(cp))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user