Merge branch 'rs/run-command-use-alloc-array'
[gitweb.git] / http-backend.c
index 8076b1d5e5ae01341fa739f55c6bcf6695e6507a..f3dc218b2a3d2662efda56fb6c8878a37a4e67a4 100644 (file)
@@ -358,7 +358,7 @@ static void inflate_request(const char *prog_name, int out, int buffer_input)
                                die("zlib error inflating request, result %d", ret);
 
                        n = stream.total_out - cnt;
-                       if (write_in_full(out, out_buf, n) != n)
+                       if (write_in_full(out, out_buf, n) < 0)
                                die("%s aborted reading request", prog_name);
                        cnt += n;
 
@@ -379,7 +379,7 @@ static void copy_request(const char *prog_name, int out)
        ssize_t n = read_request(0, &buf);
        if (n < 0)
                die_errno("error reading request body");
-       if (write_in_full(out, buf, n) != n)
+       if (write_in_full(out, buf, n) < 0)
                die("%s aborted reading request", prog_name);
        close(out);
        free(buf);
@@ -486,10 +486,9 @@ static int show_head_ref(const char *refname, const struct object_id *oid,
        struct strbuf *buf = cb_data;
 
        if (flag & REF_ISSYMREF) {
-               struct object_id unused;
                const char *target = resolve_ref_unsafe(refname,
                                                        RESOLVE_REF_READING,
-                                                       unused.hash, NULL);
+                                                       NULL, NULL);
 
                if (target)
                        strbuf_addf(buf, "ref: %s\n", strip_namespace(target));