pasta, tcp: Set pipe descriptor numbers to -1 after closing
...so that we don't try to close them again, even if harmless. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
d481578882
commit
3be131280d
1 changed files with 4 additions and 0 deletions
4
tcp.c
4
tcp.c
|
@ -1583,11 +1583,15 @@ static void tcp_splice_destroy(struct ctx *c, struct tcp_splice_conn *conn)
|
||||||
case SPLICE_ESTABLISHED:
|
case SPLICE_ESTABLISHED:
|
||||||
if (conn->pipe_from_to[0] != -1) {
|
if (conn->pipe_from_to[0] != -1) {
|
||||||
close(conn->pipe_from_to[0]);
|
close(conn->pipe_from_to[0]);
|
||||||
|
conn->pipe_from_to[0] = -1;
|
||||||
close(conn->pipe_from_to[1]);
|
close(conn->pipe_from_to[1]);
|
||||||
|
conn->pipe_from_to[1] = -1;
|
||||||
}
|
}
|
||||||
if (conn->pipe_to_from[0] != -1) {
|
if (conn->pipe_to_from[0] != -1) {
|
||||||
close(conn->pipe_to_from[0]);
|
close(conn->pipe_to_from[0]);
|
||||||
|
conn->pipe_to_from[0] = -1;
|
||||||
close(conn->pipe_to_from[1]);
|
close(conn->pipe_to_from[1]);
|
||||||
|
conn->pipe_to_from[1] = -1;
|
||||||
}
|
}
|
||||||
/* Falls through */
|
/* Falls through */
|
||||||
case SPLICE_CONNECT:
|
case SPLICE_CONNECT:
|
||||||
|
|
Loading…
Reference in a new issue