From e67be314953bc10ccdf6396d87edf338cb18ad11 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Tue, 18 Feb 2025 02:01:23 +0800 Subject: [PATCH] git_hooks_client.c: Ignore SIGPIPE --- git_hooks_client/git_hooks_client.c | 6 ++++++ diff --git a/git_hooks_client/git_hooks_client.c b/git_hooks_client/git_hooks_client.c index b5e4ed809f8602d735b86feeed85842e569afe6a..e00ab3a8cca4ebfc8fd02bc7febf8fa6249df048 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 +#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"); -- 2.48.1