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:
parent
60478de3e5
commit
b9e3c243d4
|
@ -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))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue