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

Better error messages.

Rev: src/lsh.c:1.8
Rev: src/lshd.c:1.5
parent 1a59667e
......@@ -23,8 +23,10 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <stdio.h>
#include <errno.h>
#include <locale.h>
#include <stdio.h>
#include <string.h>
#include "getopt.h"
......@@ -93,13 +95,17 @@ int main(int argc, char **argv)
random_seed = ssh_format("%z", "gazonk");
io_connect(&backend, &remote, NULL,
make_client_callback(&backend,
"lsh - a free ssh",
BLOCK_SIZE,
make_poor_random(&sha_algorithm,
random_seed)));
if (!io_connect(&backend, &remote, NULL,
make_client_callback(&backend,
"lsh - a free ssh",
BLOCK_SIZE,
make_poor_random(&sha_algorithm,
random_seed))))
{
werror("lsh: Connection failed: %s\n", strerror(errno));
return 1;
}
lsh_string_free(random_seed);
io_run(&backend);
......
......@@ -22,9 +22,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
<
#include <stdio.h>
#include <errno.h>
#include <locale.h>
#include <stdio.h>
#include <string.h>
#include "getopt.h"
......@@ -87,10 +89,14 @@ int main(int argc, char **argv)
exit(1);
}
io_listen(&backend, &local,
if (!io_listen(&backend, &local,
make_server_callback(&backend,
"lsh - a free ssh",
BLOCK_SIZE));
BLOCK_SIZE)))
{
werror("lsh: Connection failed: %s\n", strerror(errno));
return 1;
}
io_run(&backend);
......
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