From e67be314953bc10ccdf6396d87edf338cb18ad11 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Tue, 18 Feb 2025 02:01:23 +0800 Subject: git_hooks_client.c: Ignore SIGPIPE --- git_hooks_client/git_hooks_client.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/git_hooks_client/git_hooks_client.c b/git_hooks_client/git_hooks_client.c index b5e4ed8..e00ab3a 100644 --- a/git_hooks_client/git_hooks_client.c +++ b/git_hooks_client/git_hooks_client.c @@ -8,8 +8,14 @@ #include #include #include +#include int main(int argc, char *argv[]) { + if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) { + perror("signal"); + return EXIT_FAILURE; + } + const char *socket_path = getenv("LINDENII_FORGE_HOOKS_SOCKET_PATH"); if (socket_path == NULL) { dprintf(STDERR_FILENO, "environment variable LINDENII_FORGE_HOOKS_SOCKET_PATH undefined\n"); -- cgit v1.2.3