aboutgitcodebugslistschat
path: root/tcp_splice.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2022-03-27 13:10:26 +0200
committerStefano Brivio <sbrivio@redhat.com>2022-03-29 15:35:38 +0200
commit62c3edd9575cb7dfef0d86392e4b87a4c14d8dee (patch)
treea81a324ef38fdbb62c42f25dfa6cfdaec41480c0 /tcp_splice.c
parentad7f57a5b75ae62b48e5ff4f0c302f545dea2603 (diff)
downloadpasst-62c3edd9575cb7dfef0d86392e4b87a4c14d8dee.tar
passt-62c3edd9575cb7dfef0d86392e4b87a4c14d8dee.tar.gz
passt-62c3edd9575cb7dfef0d86392e4b87a4c14d8dee.tar.bz2
passt-62c3edd9575cb7dfef0d86392e4b87a4c14d8dee.tar.lz
passt-62c3edd9575cb7dfef0d86392e4b87a4c14d8dee.tar.xz
passt-62c3edd9575cb7dfef0d86392e4b87a4c14d8dee.tar.zst
passt-62c3edd9575cb7dfef0d86392e4b87a4c14d8dee.zip
treewide: Fix android-cloexec-* clang-tidy warnings, re-enable checks
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tcp_splice.c')
-rw-r--r--tcp_splice.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/tcp_splice.c b/tcp_splice.c
index 0f4f485..714571c 100644
--- a/tcp_splice.c
+++ b/tcp_splice.c
@@ -370,8 +370,8 @@ static int tcp_splice_connect_finish(const struct ctx *c,
}
if (conn->pipe_a_b[0] < 0) {
- if (pipe2(conn->pipe_a_b, O_NONBLOCK) ||
- pipe2(conn->pipe_b_a, O_NONBLOCK)) {
+ if (pipe2(conn->pipe_a_b, O_NONBLOCK | O_CLOEXEC) ||
+ pipe2(conn->pipe_b_a, O_NONBLOCK | O_CLOEXEC)) {
conn_flag(c, conn, CLOSING);
return -EIO;
}
@@ -773,7 +773,7 @@ static void tcp_set_pipe_size(struct ctx *c)
smaller:
for (i = 0; i < TCP_SPLICE_PIPE_POOL_SIZE * 2; i++) {
- if (pipe2(probe_pipe[i], 0)) {
+ if (pipe2(probe_pipe[i], O_CLOEXEC)) {
i++;
break;
}
@@ -809,9 +809,9 @@ static void tcp_splice_pipe_refill(const struct ctx *c)
for (i = 0; i < TCP_SPLICE_PIPE_POOL_SIZE; i++) {
if (splice_pipe_pool[i][0][0] >= 0)
break;
- if (pipe2(splice_pipe_pool[i][0], O_NONBLOCK))
+ if (pipe2(splice_pipe_pool[i][0], O_NONBLOCK | O_CLOEXEC))
continue;
- if (pipe2(splice_pipe_pool[i][1], O_NONBLOCK)) {
+ if (pipe2(splice_pipe_pool[i][1], O_NONBLOCK | O_CLOEXEC)) {
close(splice_pipe_pool[i][1][0]);
close(splice_pipe_pool[i][1][1]);
continue;
@@ -832,7 +832,6 @@ void tcp_splice_init(struct ctx *c)
{
memset(splice_pipe_pool, 0xff, sizeof(splice_pipe_pool));
tcp_set_pipe_size(c);
- tcp_splice_pipe_refill(c);
}
/**