summaryrefslogtreecommitdiff
path: root/pkt-line.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-06-21 02:50:59 -0700
committerJunio C Hamano <junkio@cox.net>2006-06-21 02:50:59 -0700
commit3bec0da08d6df03a103ddc4237cf2c79992c7dd4 (patch)
treec6b26993418a86b7c1eb72dcdff17489b5e410b1 /pkt-line.c
parent48401221b349696357b35e02ff3e2c3d3c89d306 (diff)
parent583b7ea31b7c16f872b178d541591ab816d16f85 (diff)
downloadgit-3bec0da08d6df03a103ddc4237cf2c79992c7dd4.tar.gz
Merge branch 'jc/upload-corrupt' into next
* jc/upload-corrupt: upload-pack/fetch-pack: support side-band communication Retire git-clone-pack upload-pack: prepare for sideband message support. upload-pack: avoid sending an incomplete pack upon failure Fix possible out-of-bounds array access
Diffstat (limited to 'pkt-line.c')
-rw-r--r--pkt-line.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkt-line.c b/pkt-line.c
index bb3bab05cd..3d724acf23 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;
}
/*