X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=wrapper.c;h=85f09df747637b94e0488ad65984c3f97c732034;hb=cb2ed324fc917db0b79d7b1f3756575ffa5f70d5;hp=4c147d6c48c000bab636fad3edc2fe7da6670948;hpb=ed36a48e6d246f4f60d44b27e8c1e660151cd0b4;p=git.git diff --git a/wrapper.c b/wrapper.c index 4c147d6c4..85f09df74 100644 --- a/wrapper.c +++ b/wrapper.c @@ -148,8 +148,10 @@ ssize_t read_in_full(int fd, void *buf, size_t count) while (count > 0) { ssize_t loaded = xread(fd, p, count); - if (loaded <= 0) - return total ? total : loaded; + if (loaded < 0) + return -1; + if (loaded == 0) + return total; count -= loaded; p += loaded; total += loaded; @@ -209,7 +211,7 @@ int xmkstemp(char *template) if (!template[0]) template = origtemplate; - nonrelative_template = make_nonrelative_path(template); + nonrelative_template = absolute_path(template); errno = saved_errno; die_errno("Unable to create temporary file '%s'", nonrelative_template); @@ -344,7 +346,7 @@ int xmkstemp_mode(char *template, int mode) if (!template[0]) template = origtemplate; - nonrelative_template = make_nonrelative_path(template); + nonrelative_template = absolute_path(template); errno = saved_errno; die_errno("Unable to create temporary file '%s'", nonrelative_template);