Index: /branches/eam_branches/ipp-20111122/Ohana/src/photdbc/Makefile
===================================================================
--- /branches/eam_branches/ipp-20111122/Ohana/src/photdbc/Makefile	(revision 33239)
+++ /branches/eam_branches/ipp-20111122/Ohana/src/photdbc/Makefile	(revision 33240)
@@ -1,3 +1,3 @@
-default: photdbc
+default: photdbc dvodist
 help:
 	@echo "make options: photdbc (default)"
@@ -36,5 +36,4 @@
 $(SRC)/Shutdown_dvodist.$(ARCH).o     	\
 $(SRC)/SetSignals.$(ARCH).o             \
-$(SRC)/rconnect.$(ARCH).o               \
 $(SRC)/md5_ops.$(ARCH).o                \
 $(SRC)/md5.$(ARCH).o                    \
Index: /branches/eam_branches/ipp-20111122/Ohana/src/photdbc/include/dvodist.h
===================================================================
--- /branches/eam_branches/ipp-20111122/Ohana/src/photdbc/include/dvodist.h	(revision 33239)
+++ /branches/eam_branches/ipp-20111122/Ohana/src/photdbc/include/dvodist.h	(revision 33240)
@@ -5,30 +5,6 @@
 # include <unistd.h> // needed?
 
-# define myAssert(LOGIC,MSG) { if (!(LOGIC)) { fprintf (stderr, "%s\n", MSG); abort(); } }
-
 // used by the md5 stuff
 # define NDIGEST  16
-
-typedef enum {
-    MODE_NONE = 0,
-    MODE_OUT  = 1,
-    MODE_IN   = 2,
-} ModeType;
-
-typedef struct {
-  char *hostname;
-  char *pathname;
-  int hostID;
-} HostInfo;
-
-typedef struct {
-  int Nhosts;
-  HostInfo *hosts;
-  unsigned short *index;
-} HostTable;
-
-// these should be moved to dvo.h?
-# define DATA_ON_TGT       0x01
-# define DATA_COPY_FAILURE 0x02
 
 /* global variables */
@@ -42,5 +18,4 @@
 
 void          LockDatabase (char *catdir);
-HostTable    *HostTableLoad (char *catdir, char *rootname);
 int           CheckHostsAndPaths (HostTable *table);
 
@@ -54,7 +29,4 @@
 void 	      SetProtect (int mode);
 int 	      SetSignals (void);
-int           rconnect (char *command, char *hostname, char *shell, int *stdio);
 
-int           write_fmt (int fd, char *format, ...);
-char         *memstr (char *m1, char *m2, int n);
 int           get_md5_with_copy (char *input, char *output, md5_byte_t *digest);
Index: /branches/eam_branches/ipp-20111122/Ohana/src/photdbc/src/HostTableLoad.c
===================================================================
--- /branches/eam_branches/ipp-20111122/Ohana/src/photdbc/src/HostTableLoad.c	(revision 33239)
+++ /branches/eam_branches/ipp-20111122/Ohana/src/photdbc/src/HostTableLoad.c	(revision 33240)
@@ -1,114 +1,4 @@
 # include "dvodist.h"
 # define DEBUG 1
-
-void InitHosts (HostInfo *hosts, int Nhosts, int NHOSTS) {
-
-  int i;
-  for (i = Nhosts; i < NHOSTS; i++) {
-    hosts[i].hostname = NULL;
-    hosts[i].pathname = NULL;
-  }
-  return;
-}
-
-void FreeHosts (HostInfo *hosts, int Nhosts) {
-
-  int i;
-  for (i = 0; i < Nhosts; i++) {
-    free (hosts[i].hostname);
-    free (hosts[i].pathname);
-  }
-  free (hosts);
-  return;
-}
-
-HostTable *HostTableLoad (char *catdir, char *rootname) {
-
-  int i, Nline;
-
-  char *filename = NULL;
-
-  ALLOCATE (filename, char, strlen(catdir) + strlen(rootname) + 2); // one slash and one EOL
-  sprintf (filename, "%s/%s", catdir, rootname);
-
-  FILE *f = fopen (filename, "r");
-  if (!f) {
-    fprintf (stderr, "failed to open host table %s\n", filename);
-    return NULL;
-  }
-
-  // simple format: ID hostname pathname
-  
-  int NHOSTS = 16;
-  int Nhosts = 0;
-  HostInfo *hosts = NULL;
-  ALLOCATE (hosts, HostInfo, NHOSTS);
-  InitHosts (hosts, Nhosts, NHOSTS);
-
-  int maxID = 0;
-
-  for (Nline = 0; TRUE; Nline ++) {
-    int ID;
-    char tmphost[1024];
-    char tmppath[1024];
-    char line[1024];
-
-    // XXXX use this for safety: int status = scan_line_maxlen (f, line, 1024);
-    int status = scan_line (f, line);
-    if (status == EOF) break;
-
-    // find first non-whitespace char & skip commented lines
-    for (i = 0; OHANA_WHITESPACE (line[i]); i++);
-    if (line[i] == '#') continue;
-
-    status = sscanf (line, "%d %1023s %1023s", &ID, tmphost, tmppath);
-    if (status != 3) {
-      fprintf (stderr, "error reading line %d of host table %s\n", Nline, filename);
-      FreeHosts (hosts, Nhosts);
-      return NULL;
-    }
-
-    // check the validity of ID (0 < ID < MAX_SHORT)
-
-    if (ID < 1) {
-      fprintf (stderr, "invalid host ID %d\n", ID);
-      exit (1);
-    }
-    if (ID > 255) {
-      fprintf (stderr, "invalid host ID %d\n", ID);
-      exit (1);
-    }
-    maxID = MAX(maxID, ID);
-
-    hosts[Nhosts].hostID = ID;
-    hosts[Nhosts].hostname = strcreate(tmphost);
-    hosts[Nhosts].pathname = strcreate(tmppath);
-    
-    Nhosts ++;
-    if (Nhosts >= NHOSTS) {
-      NHOSTS += 16;
-      REALLOCATE (hosts, HostInfo, NHOSTS);
-      InitHosts (hosts, Nhosts, NHOSTS);
-    }
-  }    
-
-  HostTable *table = NULL;
-  ALLOCATE (table, HostTable, 1);
-  table->Nhosts = Nhosts;
-  table->hosts = hosts;
-
-  ALLOCATE (table->index, unsigned short, maxID + 1);
-  for (i = 0; i <= maxID; i++) table->index[i] = -1;
-
-  for (i = 0; i < table->Nhosts; i++) {
-    if (table->index[table->hosts[i].hostID] == -1) {
-      fprintf (stderr, "error: duplicate hostID %d\n", table->hosts[i].hostID);
-      exit (1);
-    }
-    table->index[table->hosts[i].hostID] = i;
-  }
-
-  return table;
-}
 
 int CheckHostsAndPaths (HostTable *table) {
@@ -127,8 +17,9 @@
     if (DEBUG) fprintf (stderr, "starting host within thread\n");
 
-    int pid = rconnect (command, table->hosts[i].hostname, shell, stdio);
+    int errorInfo;
+    int pid = rconnect (command, table->hosts[i].hostname, shell, stdio, &errorInfo, TRUE);
     if (!pid) {     
       /** failure to start: extend retry period **/
-      if (DEBUG) fprintf (stderr, "failure to start %s\n", table->hosts[i].hostname);
+      if (DEBUG) fprintf (stderr, "failure to start %s (error %d)\n", table->hosts[i].hostname, errorInfo);
       exit (1);
     }
