Commit cb69ca10 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Revise last revision; allow -t (timeout) option to in normal and UDP

mode.
parent f727cc8e
......@@ -43,7 +43,7 @@ char *usagestr =
" -v versnum Specify a version number for tmcd\n"
" -n vnodeid Specify the vnodeid\n"
" -u Use UDP instead of TCP\n"
" -t timeout Timeout waiting for a reply from master (UDP ONLY).\n"
" -t timeout Timeout waiting for the controller.\n"
"\n";
void
......@@ -65,8 +65,8 @@ main(int argc, char **argv)
char *bossnode = DEFAULT_BOSSNODE;
int version = CURRENT_VERSION;
char *vnodeid = NULL;
#ifdef UDP
int waitfor = 0;
#ifdef UDP
int useudp = 0;
#endif
......@@ -86,10 +86,10 @@ main(int argc, char **argv)
case 'v':
version = atoi(optarg);
break;
#ifdef UDP
case 't':
waitfor = atoi(optarg);
break;
#ifdef UDP
case 'u':
useudp = 1;
break;
......@@ -134,6 +134,10 @@ main(int argc, char **argv)
exit(1);
}
if (waitfor) {
alarm(waitfor);
}
/*
* Handle built-in "bossinfo" command
*/
......@@ -346,9 +350,6 @@ doudp(int argc, char **argv,
exit(1);
}
if (waitfor) {
alarm(waitfor);
}
cc = recvfrom(sock, buf, sizeof(buf), 0,
(struct sockaddr *)&client, &length);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment