diff options
author | Nicolas Pitre <nico@cam.org> | 2006-10-11 11:49:15 -0400 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-10-11 11:13:01 -0700 |
commit | 9ac13ec941933c32849c2284b5d79ef608023a56 (patch) | |
tree | 618d32a6ba80037f6597f1ad88d9b6405701cd5f /fetch-clone.c | |
parent | 0503f9c178c36a19e1f8e8930b367db0f58ce5ca (diff) | |
download | git-9ac13ec941933c32849c2284b5d79ef608023a56.tar.gz |
atomic write for sideband remote messages
It has been a few times that I ended up with such a confusing display:
|remote: Generating pack...
|remote: Done counting 17 objects.
|remote: Result has 9 objects.
|remote: Deltifying 9 objects.
|remote: 100% (9/9) done
|remote: Unpacking 9 objects
|Total 9, written 9 (delta 8), reused 0 (delta 0)
| 100% (9/9) done
The confusion can be avoided in most cases by writing the remote message
in one go to prevent interleacing with local messages. The buffer
declaration has been moved inside recv_sideband() to avoid extra string
copies.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'fetch-clone.c')
-rw-r--r-- | fetch-clone.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/fetch-clone.c b/fetch-clone.c index b632ca0438..76b99afcdb 100644 --- a/fetch-clone.c +++ b/fetch-clone.c @@ -115,12 +115,10 @@ static pid_t setup_sideband(int sideband, const char *me, int fd[2], int xd[2]) die("%s: unable to fork off sideband demultiplexer", me); if (!side_pid) { /* subprocess */ - char buf[LARGE_PACKET_MAX]; - close(fd[0]); if (xd[0] != xd[1]) close(xd[1]); - if (recv_sideband(me, xd[0], fd[1], 2, buf, sizeof(buf))) + if (recv_sideband(me, xd[0], fd[1], 2)) exit(1); exit(0); } |