From 9c4389776a8f766932bb9b2cf4f7f3ec7de3de2b Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 29 Mar 2025 21:16:34 +0800 Subject: [PATCH] hookc: Fix variable placement --- hookc/hookc.c | 4 ++-- diff --git a/hookc/hookc.c b/hookc/hookc.c index 14acc0100093efb311fced22005eecc4e99a39a8..83b3a5e13ee1ada450d133d1828460ed510137b0 100644 --- a/hookc/hookc.c +++ b/hookc/hookc.c @@ -200,8 +200,8 @@ /* * Splice stdin to the daemon. For pre-receive it's just old/new/ref. */ - ssize_t stdin_bytes_spliced; #if USE_SPLICE + ssize_t stdin_bytes_spliced; while ((stdin_bytes_spliced = splice(STDIN_FILENO, NULL, sock, NULL, stdin_pipe_size, SPLICE_F_MORE)) > 0) { } if (stdin_bytes_spliced == -1) { @@ -272,8 +272,8 @@ * * We usually don't actually use this as the daemon could easily write * to the SSH connection's stderr directly anyway. */ - ssize_t stderr_bytes_spliced; #if USE_SPLICE + ssize_t stderr_bytes_spliced; while ((stderr_bytes_spliced = splice(sock, NULL, STDERR_FILENO, NULL, stderr_pipe_size, SPLICE_F_MORE)) > 0) { } if (stderr_bytes_spliced == -1 && errno != ECONNRESET) { -- 2.48.1