Commit 6d220a45 authored by Niels Möller's avatar Niels Möller
Browse files

Use proper exit code.

Rev: src/lsh.c:1.22
parent 7747254c
...@@ -96,6 +96,8 @@ int main(int argc, char **argv) ...@@ -96,6 +96,8 @@ int main(int argc, char **argv)
char *port = "ssh"; char *port = "ssh";
int option; int option;
int lsh_exit_code;
struct sockaddr_in remote; struct sockaddr_in remote;
/* STATIC, because the object exists at gc time */ /* STATIC, because the object exists at gc time */
...@@ -201,7 +203,7 @@ int main(int argc, char **argv) ...@@ -201,7 +203,7 @@ int main(int argc, char **argv)
make_client_startup(io_read(&backend, in, NULL, NULL), make_client_startup(io_read(&backend, in, NULL, NULL),
io_write(&backend, out, BLOCK_SIZE, NULL), io_write(&backend, out, BLOCK_SIZE, NULL),
io_write(&backend, err, BLOCK_SIZE, NULL), io_write(&backend, err, BLOCK_SIZE, NULL),
ATOM_SHELL, ssh_format(""))); ATOM_SHELL, ssh_format(""), &lsh_exit_code));
kexinit_handler = make_kexinit_handler kexinit_handler = make_kexinit_handler
(CONNECTION_CLIENT, (CONNECTION_CLIENT,
...@@ -224,9 +226,12 @@ int main(int argc, char **argv) ...@@ -224,9 +226,12 @@ int main(int argc, char **argv)
lsh_string_free(random_seed); lsh_string_free(random_seed);
/* Exit code if no session is established */
lsh_exit_code = 17;
io_run(&backend); io_run(&backend);
return 0; return lsh_exit_code;
} }
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