diff options
author | Runxi Yu <me@runxiyu.org> | 2025-02-18 02:01:23 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-02-18 02:01:23 +0800 |
commit | e67be314953bc10ccdf6396d87edf338cb18ad11 (patch) | |
tree | 61aee1f39f3b52665a5f5df7e62b61b81670b18d /git_hooks_client/git_hooks_client.c | |
parent | git_hooks_client.c: Allow ECONNRESET when splicing sock -> stderr (diff) | |
download | forge-e67be314953bc10ccdf6396d87edf338cb18ad11.tar.gz forge-e67be314953bc10ccdf6396d87edf338cb18ad11.tar.zst forge-e67be314953bc10ccdf6396d87edf338cb18ad11.zip |
git_hooks_client.c: Ignore SIGPIPE
Diffstat (limited to '')
-rw-r--r-- | git_hooks_client/git_hooks_client.c | 6 |
1 files changed, 6 insertions, 0 deletions
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 <sys/stat.h> #include <string.h> #include <fcntl.h> +#include <signal.h> 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"); |