summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1ea34e3)
raw | patch | inline | side by side (parent: 1ea34e3)
author | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Sat, 9 Apr 2005 07:25:22 +0000 (00:25 -0700) | ||
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Sat, 9 Apr 2005 07:25:22 +0000 (00:25 -0700) |
Patches from Dave Jones and Ingo Molnar, but since I don't have any
infrastructure in place to use the old patch applicator scripts I
am trying to build up, I ended up fixing the thing by hand instead.
Credit where credit is due, though. Nice to see that people are
taking a look at the project even in this early stage.
infrastructure in place to use the old patch applicator scripts I
am trying to build up, I ended up fixing the thing by hand instead.
Credit where credit is due, though. Nice to see that people are
taking a look at the project even in this early stage.
cache.h | patch | blob | history | |
fsck-cache.c | patch | blob | history | |
read-cache.c | patch | blob | history |
index 864f70bfe5aad68614a50c825d724833294834de..900824abfab44b8aa0c23d0942a4e0a3d2b00df4 100644 (file)
--- a/cache.h
+++ b/cache.h
unsigned int st_size;
unsigned char sha1[20];
unsigned short namelen;
- unsigned char name[0];
+ char name[0];
};
const char *sha1_file_directory;
diff --git a/fsck-cache.c b/fsck-cache.c
index 0a97566e87480b4e839c692d5d3a405b0cf3643b..a01513ed4d4d565911a60981bfb4173311ba3688 100644 (file)
--- a/fsck-cache.c
+++ b/fsck-cache.c
size -= len + 20;
mark_needs_sha1(sha1, "blob", file_sha1);
}
+ return 0;
}
static int fsck_commit(unsigned char *sha1, void *data, unsigned long size)
mark_needs_sha1(sha1, "commit", parent_sha1);
data += 7 + 40 + 1; /* "parent " + <hex sha1> + '\n' */
}
+ return 0;
}
static int fsck_entry(unsigned char *sha1, char *tag, void *data, unsigned long size)
diff --git a/read-cache.c b/read-cache.c
index 2ede67dbe17530e5b6dd4893430327b9121751fb..50d0be35e80bf53f7df6461be3280653fb626e96 100644 (file)
--- a/read-cache.c
+++ b/read-cache.c
size = 0; // avoid gcc warning
map = (void *)-1;
if (!fstat(fd, &st)) {
- map = NULL;
size = st.st_size;
errno = EINVAL;
- if (size > sizeof(struct cache_header))
+ if (size >= sizeof(struct cache_header))
map = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
}
close(fd);