X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=entry.c;h=1c7e3c11d5075d4b39eeca76ab2272e781f773c8;hb=4f665f2cf3374db615bd094269e5dd6eb0811006;hp=cb291aa88bf148608184edeff68943315b44e6ab;hpb=30675f7021f92b0e830fdb3c96370826d8f6723f;p=git-core%2Fgit.git diff --git a/entry.c b/entry.c index cb291aa88..1c7e3c11d 100644 --- a/entry.c +++ b/entry.c @@ -257,7 +257,8 @@ static int write_entry(struct cache_entry *ce, char *new; struct strbuf buf = STRBUF_INIT; unsigned long size; - size_t wrote, newsize = 0; + ssize_t wrote; + size_t newsize = 0; struct stat st; const struct submodule *sub; @@ -332,7 +333,7 @@ static int write_entry(struct cache_entry *ce, fstat_done = fstat_output(fd, state, &st); close(fd); free(new); - if (wrote != size) + if (wrote < 0) return error("unable to write file %s", path); break; case S_IFGITLINK: