Index: trunk/Ohana/src/opihi/pcontrol/CheckSystem.c
===================================================================
--- trunk/Ohana/src/opihi/pcontrol/CheckSystem.c	(revision 41489)
+++ trunk/Ohana/src/opihi/pcontrol/CheckSystem.c	(revision 42389)
@@ -4,4 +4,11 @@
 static struct timeval lastlive = {0, 0};
 static RunLevels RunLevel = PCONTROL_RUN_NONE;
+
+static int CheckSystemThreadRuns = TRUE;
+
+void QuitCheckSystemThread (void) {
+  CheckSystemThreadRuns = FALSE;  
+}
+
 
 RunLevels SetRunLevel (RunLevels level) {
@@ -67,5 +74,5 @@
   gprintInit ();
 
-  while (1) {
+  while (CheckSystemThreadRuns) {
     // stop here if the user-thread requests (no objects in flight) 
     TestCheckPoint ();
Index: trunk/Ohana/src/opihi/pcontrol/pcontrol.c.in
===================================================================
--- trunk/Ohana/src/opihi/pcontrol/pcontrol.c.in	(revision 41489)
+++ trunk/Ohana/src/opihi/pcontrol/pcontrol.c.in	(revision 42389)
@@ -9,4 +9,8 @@
 # define opihi_rcfile ".pcontrolrc"
 
+# ifdef THREADED  
+  static pthread_t clientsThread;
+# endif
+
 /* program-dependent initialization */
 void program_init (int *argc, char **argv) {
@@ -14,8 +18,4 @@
   OHANA_UNUSED_PARAM(argv);
   
-# ifdef THREADED  
-  pthread_t clientsThread;
-# endif
-
   auto_break = TRUE;
 
@@ -83,6 +83,8 @@
   SetRunLevel (PCONTROL_RUN_HOSTS); 
   DownHosts ();
+
+  QuitCheckSystemThread(); pthread_join (clientsThread, NULL);
+
   ConfigFree ();
-
   FreeBasic ();
   FreePcontrol ();
Index: trunk/Ohana/src/opihi/pcontrol/test/linesize.sh
===================================================================
--- trunk/Ohana/src/opihi/pcontrol/test/linesize.sh	(revision 41489)
+++ trunk/Ohana/src/opihi/pcontrol/test/linesize.sh	(revision 42389)
@@ -27,5 +27,5 @@
 
   for i 1 10
-    job echo $inline7
+    job echo $inline6
   end
 
@@ -34,5 +34,5 @@
   for i 1 10
     stdout $i -var outline
-    strlen "$inline7" Nin
+    strlen "$inline6" Nin
     strlen "$outline" Nout
 
