Catch IPv4-only failure case

A eafnosupport error is returned if IPv4 is not supported at all,
but eaddrnotavail can also be returned if the system is not configured
to allow listening at 0::1.
This commit is contained in:
2024-03-21 10:54:24 +09:00
parent 36c4838245
commit 5069ebe3b8
58 changed files with 51 additions and 50 deletions
+44
View File
@@ -0,0 +1,44 @@
#! /usr/bin/env escript
-mode(compile).
main(Args) ->
true = code:add_patha("ebin"),
case make:all() of
up_to_date ->
lists:foreach(fun dispatch/1, Args),
halt(0);
error ->
ok = io:format("Build error. Halting.~n"),
halt(1)
end.
dispatch("edoc") ->
ok = edoc();
dispatch("dialyze") ->
ok = dialyze();
dispatch("test") ->
ok = test();
dispatch(Unknown) ->
ok = io:format("make_zx: Unknown directive: ~tp~n", [Unknown]),
halt(1).
edoc() ->
ok = io:format("EDOC: Writing docs...~n"),
edoc:application(zx, ".", []).
dialyze() ->
case dialyzer:run([{from, src_code}, {files_rec, ["./src"]}]) of
[] ->
io:format("Dialyzer found no errors and returned no warnings! Yay!~n");
Warnings ->
Messages = [dialyzer:format_warning(W) || W <- Warnings],
lists:foreach(fun io:format/1, Messages)
end.
test() ->
io:format("TEST: If I only had a brain.~n").