Skip to content

Commit

Permalink
Use close instead of shutdown to free fd
Browse files Browse the repository at this point in the history
  • Loading branch information
cbascom committed May 31, 2012
1 parent 7661872 commit a3efb61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions beanstalk.c
Expand Up @@ -72,15 +72,15 @@ int bs_connect(char *host, int port) {

freeaddrinfo(addr);
if (connect(fd, (struct sockaddr*)&server, sizeof(server)) != 0) {
shutdown(fd, SHUT_RDWR);
close(fd);
return BS_STATUS_FAIL;
}

return fd;
}

int bs_disconnect(int fd) {
shutdown(fd, SHUT_RDWR);
close(fd);
return BS_STATUS_OK;
}

Expand Down

0 comments on commit a3efb61

Please sign in to comment.