Changeset 2804
- Timestamp:
- Dec 23, 2004, 7:52:29 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/elixir/src/rconnect.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/elixir/src/rconnect.c
r2428 r2804 1 1 # include "controller.h" 2 2 /* 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> 7 7 */ 8 8 /* rconnect opens a remote shell on hostname and returns two file descriptors: … … 43 43 setvbuf (stdout, (char *) NULL, _IONBF, BUFSIZ); 44 44 setvbuf (stderr, (char *) NULL, _IONBF, BUFSIZ); 45 fprintf (stderr, "child is spawned\n"); 45 46 46 47 status = execl (command, file, hostname, "/bin/csh", 0); … … 50 51 *wsock = wfd[1]; 51 52 *rsock = rfd[0]; 52 close (wfd[0]);53 close (rfd[1]);54 53 close (wfd[0]); 54 close (rfd[1]); 55 55 56 fcntl (*rsock, F_SETFL, O_NONBLOCK); 56 57 fcntl (*wsock, F_SETFL, O_NONBLOCK); … … 67 68 /* try to get evidence connection is alive - wait upto a few seconds */ 68 69 status = -1; 69 for (i = 0; (i < 100) && (status == -1); i++) {70 for (i = 0; (i < 300) && (status == -1); i++) { 70 71 fcntl (*rsock, F_SETFL, O_NONBLOCK); 71 72 status = SockScan ("PTOLEMY STARTED", &fifo, *rsock); 73 if (!(i % 30)) fprintf (stderr, "."); 72 74 if (status == 0) { 73 75 fprintf (stderr, "socket closed unexpectedly\n"); … … 77 79 } 78 80 } 79 if ( i == 100) {81 if (status == -1) { 80 82 fprintf (stderr, "timeout while connecting\n"); 81 83 close (*wsock);
Note:
See TracChangeset
for help on using the changeset viewer.
