cdba: Support specifying cdba-server path

For debug purposes it's useful to install a user-local version of the
cdba-server and invoke this instead, rather then having to change the
code add a flag to support specifying this on the command line.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
Bjorn Andersson
2021-02-22 11:04:09 -06:00
parent 3004fdf68d
commit 983ec44099

8
cdba.c
View File

@@ -594,6 +594,7 @@ int main(int argc, char **argv)
struct timeval timeout_inactivity_tv;
struct timeval timeout_total_tv;
struct termios *orig_tios;
const char *server_binary = "cdba-server";
int timeout_inactivity = 0;
int timeout_total = 600;
struct work *next;
@@ -615,7 +616,7 @@ int main(int argc, char **argv)
int opt;
int ret;
while ((opt = getopt(argc, argv, "b:c:C:h:ilRt:T:")) != -1) {
while ((opt = getopt(argc, argv, "b:c:C:h:ilRt:S:T:")) != -1) {
switch (opt) {
case 'b':
board = optarg;
@@ -638,6 +639,9 @@ int main(int argc, char **argv)
case 'R':
fastboot_repeat = true;
break;
case 'S':
server_binary = optarg;
break;
case 't':
timeout_total = atoi(optarg);
break;
@@ -676,7 +680,7 @@ int main(int argc, char **argv)
break;
}
ret = fork_ssh(host, "cdba-server", ssh_fds);
ret = fork_ssh(host, server_binary, ssh_fds);
if (ret)
err(1, "failed to connect to \"%s\"", host);