summaryrefslogtreecommitdiffstats
path: root/qarsh.c
diff options
context:
space:
mode:
authorNathan Straz <nstraz@redhat.com>2010-09-28 15:03:30 -0400
committerNathan Straz <nstraz@redhat.com>2010-09-28 15:03:30 -0400
commita9b1f95507791f34422084fd47dbf74956902ee1 (patch)
treeb6b81b8114858c82058cd3e0e9de56a17fefd068 /qarsh.c
parent92a3ae3b8dcf07805a609e7bc19d5fc01b8b1555 (diff)
downloadqarsh-a9b1f95507791f34422084fd47dbf74956902ee1.tar.gz
qarsh-a9b1f95507791f34422084fd47dbf74956902ee1.tar.xz
qarsh-a9b1f95507791f34422084fd47dbf74956902ee1.zip
Wait up to 30 second to establish a connection
The user specified time for holding a connection only. If the user uses too small a time, like if they are rebooting a node, the initial connection may fail.
Diffstat (limited to 'qarsh.c')
-rw-r--r--qarsh.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/qarsh.c b/qarsh.c
index 6575bd0..ea272da 100644
--- a/qarsh.c
+++ b/qarsh.c
@@ -46,6 +46,7 @@
#define QARSH_MINPORT 5010
#define QARSH_BUFSIZE 4096
+#define CONNECT_TIMEOUT 30
/* Globals */
@@ -507,7 +508,7 @@ again:
sa.sa_handler = sig_alrm_handler;
sigaction(SIGALRM, &sa, NULL);
- alarm(max_timeout);
+ alarm(CONNECT_TIMEOUT);
qarsh_fd = connect_to_host(host, port);
alarm(0);