summaryrefslogtreecommitdiff
path: root/builtin-archive.c
diff options
context:
space:
mode:
authorJohannes Sixt <johannes.sixt@telecom.at>2007-10-19 21:47:53 +0200
committerShawn O. Pearce <spearce@spearce.org>2007-10-21 01:30:39 -0400
commit98158e9cfd2808613f305bf587ce697762c884bb (patch)
tree87502b9a44bf4ca790f60ce8639a903e23b4ac7a /builtin-archive.c
parentca5bb5d5390e4ec709ca3e11c451c58a836d4ee6 (diff)
downloadgit-98158e9cfd2808613f305bf587ce697762c884bb.tar.gz
Change git_connect() to return a struct child_process instead of a pid_t.
This prepares the API of git_connect() and finish_connect() to operate on a struct child_process. Currently, we just use that object as a placeholder for the pid that we used to return. A follow-up patch will change the implementation of git_connect() and finish_connect() to make full use of the object. Old code had early-return-on-error checks at the calling sites of git_connect(), but since git_connect() dies on errors anyway, these checks were removed. [sp: Corrected style nit of "conn == NULL" to "!conn"] Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'builtin-archive.c')
-rw-r--r--builtin-archive.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/builtin-archive.c b/builtin-archive.c
index 04385dea05..76f8d3d83d 100644
--- a/builtin-archive.c
+++ b/builtin-archive.c
@@ -30,7 +30,7 @@ static int run_remote_archiver(const char *remote, int argc,
{
char *url, buf[LARGE_PACKET_MAX];
int fd[2], i, len, rv;
- pid_t pid;
+ struct child_process *conn;
const char *exec = "git-upload-archive";
int exec_at = 0;
@@ -46,9 +46,7 @@ static int run_remote_archiver(const char *remote, int argc,
}
url = xstrdup(remote);
- pid = git_connect(fd, url, exec, 0);
- if (pid < 0)
- return pid;
+ conn = git_connect(fd, url, exec, 0);
for (i = 1; i < argc; i++) {
if (i == exec_at)
@@ -76,7 +74,7 @@ static int run_remote_archiver(const char *remote, int argc,
rv = recv_sideband("archive", fd[0], 1, 2);
close(fd[0]);
close(fd[1]);
- rv |= finish_connect(pid);
+ rv |= finish_connect(conn);
return !!rv;
}