From 93822c2239a336e5cb583549071c59202ef6c5b2 Mon Sep 17 00:00:00 2001 From: Andy Whitcroft Date: Mon, 8 Jan 2007 15:58:23 +0000 Subject: short i/o: fix calls to write to use xwrite or write_in_full We have a number of badly checked write() calls. Often we are expecting write() to write exactly the size we requested or fail, this fails to handle interrupts or short writes. Switch to using the new write_in_full(). Otherwise we at a minimum need to check for EINTR and EAGAIN, where this is appropriate use xwrite(). Note, the changes to config handling are much larger and handled in the next patch in the sequence. Signed-off-by: Andy Whitcroft Signed-off-by: Junio C Hamano --- builtin-tar-tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'builtin-tar-tree.c') diff --git a/builtin-tar-tree.c b/builtin-tar-tree.c index ad802fc1aa..8055ddab9b 100644 --- a/builtin-tar-tree.c +++ b/builtin-tar-tree.c @@ -82,7 +82,7 @@ int cmd_get_tar_commit_id(int argc, const char **argv, const char *prefix) if (memcmp(content, "52 comment=", 11)) return 1; - n = xwrite(1, content + 11, 41); + n = write_in_full(1, content + 11, 41); if (n < 41) die("git-get-tar-commit-id: write error"); -- cgit v1.2.3