Skip to content
This repository has been archived by the owner on Jul 18, 2020. It is now read-only.

Commit

Permalink
Exit with 111 when connection cannot be made.
Browse files Browse the repository at this point in the history
  • Loading branch information
technomancy committed Oct 2, 2013
1 parent cfdd43c commit def8734
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion grench.ml
Expand Up @@ -22,7 +22,7 @@ let repl_port port_file =
| Some port -> int_of_string port
| None -> match Sys.file_exists filename with
| `Yes -> int_of_string (In_channel.read_all filename)
| `No | `Unknown -> eprintf "%s%!" port_err; exit 1
| `No | `Unknown -> eprintf "%s%!" port_err; exit 111

let () =
if ! Sys.interactive then () else
Expand Down
4 changes: 2 additions & 2 deletions lein.ml
Expand Up @@ -4,7 +4,7 @@ open Printf
(* Invoking Leiningen tasks. *)

let port_err =
"Couldn't read port from ~/.lein/repl-port or LEIN_REPL_PORT.\n
"Couldn't read port from ~/.lein/repl-port or $LEIN_REPL_PORT.\n
If Leiningen is not running, launch `lein repl :headless' from outside a
project directory and try again.\n"

Expand All @@ -16,7 +16,7 @@ let repl_port () =
| Some port -> int_of_string port
| None -> match Sys.file_exists filename with
| `Yes -> int_of_string (In_channel.read_all filename)
| `No | `Unknown -> eprintf "%s%!" port_err; exit 1
| `No | `Unknown -> eprintf "%s%!" port_err; exit 111

let form = sprintf "(binding [*cwd* \"%s\", *exit-process?* false]
(System/setProperty \"leiningen.original.pwd\" \"%s\")
Expand Down
2 changes: 1 addition & 1 deletion nrepl.ml
Expand Up @@ -141,4 +141,4 @@ let new_session host port messages handler =
| Ok () -> ()
| Error _ ->
eprintf "Could not connect on port %i.\n%!" port;
Pervasives.exit 1
Pervasives.exit 111

0 comments on commit def8734

Please sign in to comment.