Changeset 4705 for trunk/Ohana/src/opihi/pcontrol/StartHost.c
- Timestamp:
- Aug 3, 2005, 5:50:08 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/pcontrol/StartHost.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/pcontrol/StartHost.c
r4689 r4705 1 1 # include "pcontrol.h" 2 # define RETRY_BASE 1.0 2 3 3 4 int StartHost (Host *host) { … … 6 7 int stdio[3]; 7 8 char command[64], shell[64]; 8 9 /* pid = rconnect (CONNECT, host[0].hostname, PCLIENT, stdio); */9 struct timeval now; 10 float delta; 10 11 11 12 /* perhaps change the name of these config variables... */ … … 14 15 15 16 pid = rconnect (command, host[0].hostname, shell, stdio); 16 if (!pid) { /** failure to start **/ 17 if (!pid) { 18 /** failure to start: extend retry period **/ 17 19 if (VerboseMode()) fprintf (stderr, "failure to start %s\n", host[0].hostname); 20 gettimeofday (&now, (void *) NULL); 21 if (ZTIME(host[0].nexttry) || ZTIME(host[0].lasttry)) { 22 /* reset retry period if either is zero */ 23 delta = RETRY_BASE; 24 } else { 25 delta = 2*DTIME (host[0].nexttry, host[0].lasttry); 26 } 27 host[0].nexttry.tv_sec = now.tv_sec + delta; 28 host[0].nexttry.tv_usec = now.tv_usec; 29 host[0].lasttry.tv_sec = now.tv_sec; 30 host[0].lasttry.tv_usec = now.tv_usec; 18 31 PutHost (host, PCONTROL_HOST_DOWN, STACK_BOTTOM); 19 32 return (FALSE); 20 33 } 34 host[0].nexttry.tv_sec = 0; 35 host[0].nexttry.tv_usec = 0; 36 host[0].lasttry.tv_sec = 0; 37 host[0].lasttry.tv_usec = 0; 38 21 39 host[0].stdin = stdio[0]; 22 40 host[0].stdout = stdio[1];
Note:
See TracChangeset
for help on using the changeset viewer.
