summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5cbf824)
raw | patch | inline | side by side (parent: 5cbf824)
author | Jeff King <peff@peff.net> | |
Mon, 16 May 2011 06:52:11 +0000 (02:52 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 16 May 2011 23:20:01 +0000 (16:20 -0700) |
They might care because they want to do a half-duplex close.
With pipes, that means simply closing the output descriptor;
with a socket, you must actually call shutdown.
Instead of exposing the magic no_fork child_process struct,
let's encapsulate the test in a function.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
With pipes, that means simply closing the output descriptor;
with a socket, you must actually call shutdown.
Instead of exposing the magic no_fork child_process struct,
let's encapsulate the test in a function.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h | patch | blob | history | |
connect.c | patch | blob | history |
index bf468e52352c193b355222b718d9f5125c26052c..724aad41bac20be6de9d375bac8d5d12c1c6a1b2 100644 (file)
--- a/cache.h
+++ b/cache.h
#define CONNECT_VERBOSE (1u << 0)
extern struct child_process *git_connect(int fd[2], const char *url, const char *prog, int flags);
extern int finish_connect(struct child_process *conn);
+extern int git_connection_is_socket(struct child_process *conn);
extern int path_match(const char *path, int nr, char **match);
struct extra_have_objects {
int nr, alloc;
diff --git a/connect.c b/connect.c
index 5884f6d0b22544b56100dfdfe616f79fd944f495..9b31af02baa51d4994acb5ee9bb9e88aeb31044a 100644 (file)
--- a/connect.c
+++ b/connect.c
return conn;
}
+int git_connection_is_socket(struct child_process *conn)
+{
+ return conn == &no_fork;
+}
+
int finish_connect(struct child_process *conn)
{
int code;
- if (!conn || conn == &no_fork)
+ if (!conn || git_connection_is_socket(conn))
return 0;
code = finish_command(conn);