Skip to content

Commit

Permalink
Use defined constant for sizing service buffer
Browse files Browse the repository at this point in the history
Use the defined constant for sizing the service buffer passed to
getaddrinfo, just in case we decide to accept /etc/service descriptions
in the future.
  • Loading branch information
msantos committed May 20, 2011
1 parent 994a6c7 commit 5b7126e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions c_src/procket_cmd.c
Expand Up @@ -191,7 +191,7 @@ procket_open_socket(PROCKET_STATE *ps)
struct addrinfo hints = {0};
struct addrinfo *res = NULL;
struct addrinfo *rp = NULL;
char port[10] = {0};
char port[NI_MAXSERV] = {0};
int err = 0;


Expand Down Expand Up @@ -255,7 +255,6 @@ procket_open_socket(PROCKET_STATE *ps)
procket_create_socket(PROCKET_STATE *ps, struct addrinfo *rp)
{
int flags = 0;
int err = 0;


ps->s = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol);
Expand All @@ -278,7 +277,7 @@ procket_create_socket(PROCKET_STATE *ps, struct addrinfo *rp)

ERR:
if (ps->s > -1) {
err = errno;
int err = errno;
(void)close(ps->s);
errno = err;
ps->s = -1;
Expand Down

0 comments on commit 5b7126e

Please sign in to comment.