Skip to content

Commit

Permalink
Return a tuple instead of a 3 element tuple. Consistency is good.
Browse files Browse the repository at this point in the history
  • Loading branch information
msantos committed Jan 11, 2010
1 parent 06bf60f commit 6a15ed0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion README
Expand Up @@ -8,14 +8,16 @@ R13B03.

EXPORTS

listen(Port, Options) -> {ok, FD} | {error, Reason} | {error, Reason, Description}
listen(Port, Options) -> {ok, FD} | {error, Reason} | {error, {Reason, Description}}

Types Port = 0..65535
Options = [Opts]
Opts = {pipe, Path} | {protocol, Protocol} | {ip, IPAddress} |
{progname, string()}
Protocol = tcp | udp
IPAddress = string() | tuple()
Reason = atom()
Description = string()


COMPILING
Expand Down
5 changes: 3 additions & 2 deletions c_src/procket.c
Expand Up @@ -198,10 +198,11 @@ error_tuple(ErlNifEnv *env, char *atom, char *err)
static ERL_NIF_TERM
error_message(ErlNifEnv *env, char *atom, char *err, char *msg)
{
return enif_make_tuple(env, 3,
return enif_make_tuple(env, 2,
enif_make_atom(env, atom),
enif_make_tuple(env, 2,
enif_make_atom(env, err),
enif_make_string(env, msg));
enif_make_string(env, msg)));
}


Expand Down

0 comments on commit 6a15ed0

Please sign in to comment.