X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=unix%2Fuxplink.c;h=ad122e9da4b3959f65a71f3824de1e7f3c86eb77;hb=9dd9860cc84f82309de64c33e2813c6e9dc60749;hp=64c3cabcdacc66afd58e6ec87b9684e14725a863;hpb=b266d671acee34f9305950bfd87054b3b7fcded6;p=PuTTY.git diff --git a/unix/uxplink.c b/unix/uxplink.c index 64c3cabc..ad122e9d 100644 --- a/unix/uxplink.c +++ b/unix/uxplink.c @@ -533,8 +533,8 @@ void sigwinch(int signum) * In Plink our selects are synchronous, so these functions are * empty stubs. */ -int uxsel_input_add(int fd, int rwx) { return 0; } -void uxsel_input_remove(int id) { } +uxsel_id *uxsel_input_add(int fd, int rwx) { return NULL; } +void uxsel_input_remove(uxsel_id *id) { } /* * Short description of parameters. @@ -607,6 +607,7 @@ int main(int argc, char **argv) int errors; int use_subsystem = 0; int got_host = FALSE; + int just_test_share_exists = FALSE; unsigned long now; struct winsize size; @@ -685,6 +686,8 @@ int main(int argc, char **argv) --argc; provide_xrm_string(*++argv); } + } else if (!strcmp(p, "-shareexists")) { + just_test_share_exists = TRUE; } else { fprintf(stderr, "plink: unknown option \"%s\"\n", p); errors = 1; @@ -959,6 +962,19 @@ int main(int argc, char **argv) !conf_get_str_nthstrkey(conf, CONF_portfwd, 0)) conf_set_int(conf, CONF_ssh_simple, TRUE); + if (just_test_share_exists) { + if (!back->test_for_upstream) { + fprintf(stderr, "Connection sharing not supported for connection " + "type '%s'\n", back->name); + return 1; + } + if (back->test_for_upstream(conf_get_str(conf, CONF_host), + conf_get_int(conf, CONF_port), conf)) + return 0; + else + return 1; + } + /* * Start up the connection. */