IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 2804


Ignore:
Timestamp:
Dec 23, 2004, 7:52:29 AM (22 years ago)
Author:
eugene
Message:

minor mods

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/elixir/src/rconnect.c

    r2428 r2804  
    11# include "controller.h"
    22/*
    3 # include <stdio.h>
    4 # include <math.h>
    5 # include <string.h>
    6 # include <signal.h>
     3  # include <stdio.h>
     4  # include <math.h>
     5  # include <string.h>
     6  # include <signal.h>
    77*/
    88/* rconnect opens a remote shell on hostname and returns two file descriptors:
     
    4343    setvbuf (stdout, (char *) NULL, _IONBF, BUFSIZ);
    4444    setvbuf (stderr, (char *) NULL, _IONBF, BUFSIZ);
     45    fprintf (stderr, "child is spawned\n");
    4546
    4647    status = execl (command, file, hostname, "/bin/csh", 0);
     
    5051  *wsock = wfd[1];
    5152  *rsock = rfd[0];
    52    close (wfd[0]);
    53    close (rfd[1]);
    54 
     53  close (wfd[0]);
     54  close (rfd[1]);
     55   
    5556  fcntl (*rsock, F_SETFL, O_NONBLOCK);
    5657  fcntl (*wsock, F_SETFL, O_NONBLOCK);
     
    6768  /* try to get evidence connection is alive - wait upto a few seconds */
    6869  status = -1;
    69   for (i = 0; (i < 100) && (status == -1); i++) {
     70  for (i = 0; (i < 300) && (status == -1); i++) {
    7071    fcntl (*rsock, F_SETFL, O_NONBLOCK);
    7172    status = SockScan ("PTOLEMY STARTED", &fifo, *rsock);
     73    if (!(i % 30)) fprintf (stderr, ".");
    7274    if (status == 0) {
    7375      fprintf (stderr, "socket closed unexpectedly\n");
     
    7779    }
    7880  }
    79   if (i == 100) {
     81  if (status == -1) {
    8082    fprintf (stderr, "timeout while connecting\n");
    8183    close (*wsock);
Note: See TracChangeset for help on using the changeset viewer.