Merge branch 'maint'

* maint:
  Do not use errno when pread() returns 0
  git init: --bare/--shared overrides system/global config
  git-push.txt: Describe --repo option in more detail
  git rm: refresh index before up-to-date check
  Fix a few typos in relnotes
This commit is contained in:
Shawn O. Pearce
2008-10-08 08:05:43 -07:00
8 changed files with 88 additions and 21 deletions

View File

@ -365,8 +365,11 @@ static void *get_data_from_pack(struct object_entry *obj)
data = src;
do {
ssize_t n = pread(pack_fd, data + rdy, len - rdy, from + rdy);
if (n <= 0)
if (n < 0)
die("cannot pread pack file: %s", strerror(errno));
if (!n)
die("premature end of pack file, %lu bytes missing",
len - rdy);
rdy += n;
} while (rdy < len);
data = xmalloc(obj->size);