summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/ProcessUNIX.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-06-11 15:00:38 (GMT)
committerBrad King <brad.king@kitware.com>2010-06-11 15:00:38 (GMT)
commitb9e3c243d476efa04479d253cfc4f76ecbdb6fe3 (patch)
tree73c2c342e27bbed5a4c9b258a58998486c51bae7 /Source/kwsys/ProcessUNIX.c
parent60478de3e5032a0db59f27e913fef222fe767518 (diff)
downloadCMake-b9e3c243d476efa04479d253cfc4f76ecbdb6fe3.zip
CMake-b9e3c243d476efa04479d253cfc4f76ecbdb6fe3.tar.gz
CMake-b9e3c243d476efa04479d253cfc4f76ecbdb6fe3.tar.bz2
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.
Diffstat (limited to 'Source/kwsys/ProcessUNIX.c')
-rw-r--r--Source/kwsys/ProcessUNIX.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c
index adadef1..9c66a44 100644
--- a/Source/kwsys/ProcessUNIX.c
+++ b/Source/kwsys/ProcessUNIX.c
@@ -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))
{