Index: trunk/Ohana/src/opihi/pcontrol/pclient.c
===================================================================
--- trunk/Ohana/src/opihi/pcontrol/pclient.c	(revision 3211)
+++ trunk/Ohana/src/opihi/pcontrol/pclient.c	(revision 3212)
@@ -1,8 +1,6 @@
 # include "pcontrol.h"
+# define PCLIENT_TIMEOUT 20
 
-# define PCLIENT_TIMEOUT 20
-# define PCLIENT_PROMPT "pclient:"
-
-int PclientCommand (Host *host, char *command, IOBuffer *buffer) {
+int PclientCommand (Host *host, char *command, char *response, IOBuffer *buffer) {
 
   int i;
@@ -10,6 +8,9 @@
   char *line;
 
+  ReadtoIOBuffer (buffer, host[0].stdout);
+  FlushIOBuffer (buffer);
+
   /* send command to client (adding on \n) */
-  fprintf (stderr, "send: %s (%d)\n", command, buffer[0].Nbuffer);
+  /* fprintf (stderr, "send: %s (%d)\n", command, buffer[0].Nbuffer); */
   ALLOCATE (line, char, MAX (1, strlen(command)));
   sprintf (line, "%s\n", command);
@@ -25,9 +26,10 @@
   for (i = 0; (i < PCLIENT_TIMEOUT) && (status == -1) && (line == NULL); i++) {
     status = ReadtoIOBuffer (buffer, host[0].stdout);
-    line = memstr (buffer[0].buffer, PCLIENT_PROMPT, buffer[0].Nbuffer);
+    line = memstr (buffer[0].buffer, response, buffer[0].Nbuffer);
+    if (status == -1) usleep (10000);
   }
   if (status ==  0) return (PCLIENT_DOWN);
   if (status == -1) return (PCLIENT_HUNG);
-  fprintf (stderr, "buffer.buffer: %s\n", buffer[0].buffer);
+  /* fprintf (stderr, "buffer.buffer: %s\n", buffer[0].buffer); */
   return (PCLIENT_GOOD);
 }
