aboutsummaryrefslogtreecommitdiff
path: root/git_hooks_client
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--git_hooks_client/git_hooks_client.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/git_hooks_client/git_hooks_client.c b/git_hooks_client/git_hooks_client.c
index e00ab3a..6471aa8 100644
--- a/git_hooks_client/git_hooks_client.c
+++ b/git_hooks_client/git_hooks_client.c
@@ -163,6 +163,16 @@ int main(int argc, char *argv[]) {
}
/*
+ * The sending part of the UNIX socket should be shut down, to let
+ * io.Copy on the Go side return.
+ */
+ if (shutdown(sock, SHUT_WR) == -1) {
+ perror("shutdown internal socket");
+ close(sock);
+ return EXIT_FAILURE;
+ }
+
+ /*
* The first byte of the response from the UNIX domain socket is the
* status code. We read it and record it as our return value.
*/