summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0ea9f04)
raw | patch | inline | side by side (parent: 0ea9f04)
author | Shawn O. Pearce <spearce@spearce.org> | |
Tue, 16 Jan 2007 05:35:41 +0000 (00:35 -0500) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Tue, 16 Jan 2007 05:35:41 +0000 (00:35 -0500) |
Prior to git having read_in_full() fast-import used its own private
function yread to perform the header reading task. No sense in
keeping that around now that read_in_full is a public, stable
function.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
function yread to perform the header reading task. No sense in
keeping that around now that read_in_full is a public, stable
function.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
fast-import.c | patch | blob | history |
diff --git a/fast-import.c b/fast-import.c
index ebffa7c904bc892dc086aa8a53257253764d2453..938707c5bd741beb6a111ceabef11848fc098f5e 100644 (file)
--- a/fast-import.c
+++ b/fast-import.c
avail_tree_entry = e;
}
-static void yread(int fd, void *buffer, size_t length)
-{
- ssize_t ret = 0;
- while (ret < length) {
- ssize_t size = xread(fd, (char *) buffer + ret, length - ret);
- if (!size)
- die("Read from descriptor %i: end of stream", fd);
- if (size < 0)
- die("Read from descriptor %i: %s", fd, strerror(errno));
- ret += size;
- }
-}
-
static void start_packfile()
{
struct packed_git *p;
die("Failed seeking to start: %s", strerror(errno));
SHA1_Init(&c);
- yread(pack_fd, hdr, 8);
+ if (read_in_full(pack_fd, hdr, 8) != 8)
+ die("Unable to reread header of %s", pack_data->pack_name);
SHA1_Update(&c, hdr, 8);
cnt = htonl(object_count);