path: root/pkt-line.c
diff options
authorJunio C Hamano <>2006-06-21 07:30:21 (GMT)
committerJunio C Hamano <>2006-06-21 09:50:32 (GMT)
commit583b7ea31b7c16f872b178d541591ab816d16f85 (patch)
tree988f333096d8eb42e1caf714b98d2f833001cc26 /pkt-line.c
parentefc7fa5355da79326f92716eef37ddd71c7ec034 (diff)
upload-pack/fetch-pack: support side-band communication
This implements a protocol extension between fetch-pack and upload-pack to allow stderr stream from upload-pack (primarily used for the progress bar display) to be passed back. Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'pkt-line.c')
1 files changed, 3 insertions, 1 deletions
diff --git a/pkt-line.c b/pkt-line.c
index bb3bab0..3d724ac 100644
--- a/pkt-line.c
+++ b/pkt-line.c
@@ -16,8 +16,9 @@
* The writing side could use stdio, but since the reading
* side can't, we stay with pure read/write interfaces.
-static void safe_write(int fd, const void *buf, unsigned n)
+ssize_t safe_write(int fd, const void *buf, ssize_t n)
+ ssize_t nn = n;
while (n) {
int ret = xwrite(fd, buf, n);
if (ret > 0) {
@@ -29,6 +30,7 @@ static void safe_write(int fd, const void *buf, unsigned n)
die("write error (disk full?)");
die("write error (%s)", strerror(errno));
+ return nn;