forked from dan/liminix
close socket fd if we can't connect it
This commit is contained in:
parent
21eeb1671e
commit
9e5f2d663d
@ -24,6 +24,7 @@ int open_shipper_socket(char *pathname) {
|
|||||||
if(fd >= 0) {
|
if(fd >= 0) {
|
||||||
if(connect(fd, (struct sockaddr *) &sa, sizeof sa)) {
|
if(connect(fd, (struct sockaddr *) &sa, sizeof sa)) {
|
||||||
error(0, errno, "connect socket \"%s\"", pathname);
|
error(0, errno, "connect socket \"%s\"", pathname);
|
||||||
|
close(fd);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
int flags = fcntl(fd, F_GETFL);
|
int flags = fcntl(fd, F_GETFL);
|
||||||
|
Loading…
Reference in New Issue
Block a user