Commit dd6be796 authored by Niels Möller's avatar Niels Möller

tcpconnect: Ignore SIGPIPE. Fixes to diagnostic printouts.

parent afa72761
2012-07-13 Niels Möller <nisse@lysator.liu.se> 2012-07-13 Niels Möller <nisse@lysator.liu.se>
* src/testsuite/tcpconnect.c (main): Ignore SIGPIPE. Fixes to
diagnostic printouts.
* src/lsh.c (main_argp_parser): Pass on --hostkey-algorithm and * src/lsh.c (main_argp_parser): Pass on --hostkey-algorithm and
new option --kex-algorithm to lsh-transport. new option --kex-algorithm to lsh-transport.
......
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include <signal.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
...@@ -182,6 +184,9 @@ main (int argc, char **argv) ...@@ -182,6 +184,9 @@ main (int argc, char **argv)
if (connect (fd, p->ai_addr, p->ai_addrlen) >= 0) if (connect (fd, p->ai_addr, p->ai_addrlen) >= 0)
break; break;
if (verbose)
fprintf(stderr, "Connect failed: %s\n", strerror(errno));
close (fd); close (fd);
fd = -1; fd = -1;
} }
...@@ -229,6 +234,8 @@ main (int argc, char **argv) ...@@ -229,6 +234,8 @@ main (int argc, char **argv)
else if (fcntl(fd, F_SETFL, flags | 1 | O_NONBLOCK) < 0) else if (fcntl(fd, F_SETFL, flags | 1 | O_NONBLOCK) < 0)
werror("fcntl F_SETFL failed: %s\n", strerror(errno)); werror("fcntl F_SETFL failed: %s\n", strerror(errno));
signal(SIGPIPE, SIG_IGN);
buf_size = buf_pos = 0; buf_size = buf_pos = 0;
seen_stdin_eof = seen_remote_eof = 0; seen_stdin_eof = seen_remote_eof = 0;
...@@ -362,7 +369,7 @@ main (int argc, char **argv) ...@@ -362,7 +369,7 @@ main (int argc, char **argv)
close (fd); close (fd);
if (verbose) if (verbose)
fprintf(stderr, "[Connection closed]"); fprintf(stderr, "[Connection closed]\n");
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
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