1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

ctdb-tcp: Set file descriptor to -1 after close.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12157

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
Martin Schwenke 2016-08-15 09:43:46 +10:00 committed by Martin Schwenke
parent ce451c7cc6
commit 0e73734822

View File

@ -194,6 +194,7 @@ void ctdb_tcp_node_connect(struct tevent_context *ev, struct tevent_timer *te,
DEBUG(DEBUG_ERR, (__location__ " unknown family %u\n",
sock_in.sa.sa_family));
close(tnode->fd);
tnode->fd = -1;
return;
}
@ -201,6 +202,7 @@ void ctdb_tcp_node_connect(struct tevent_context *ev, struct tevent_timer *te,
DEBUG(DEBUG_ERR, (__location__ " Failed to bind socket %s(%d)\n",
strerror(errno), errno));
close(tnode->fd);
tnode->fd = -1;
return;
}