X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=mktag.c;h=8cbbef67e624d1d15bc4f2d7e2f9509be937c36d;hb=000182eacf99cde27d5916aa415921924b82972c;hp=aa4a6d863bfb9e091b900470de2d03fa431bbfe2;hpb=91d7b8afc2dc8bacde2012ad076cd8d0c4d36697;p=git.git diff --git a/mktag.c b/mktag.c index aa4a6d86..8cbbef67 100644 --- a/mktag.c +++ b/mktag.c @@ -106,7 +106,18 @@ int main(int argc, char **argv) usage("cat | git-mktag"); // Read the signature - size = read(0, buffer, MAXSIZE); + size = 0; + for (;;) { + int ret = read(0, buffer + size, MAXSIZE - size); + if (!ret) + break; + if (ret < 0) { + if (errno == EAGAIN) + continue; + break; + } + size += ret; + } // Verify it for some basic sanity: it needs to start with "object \ntype " if (verify_tag(buffer, size) < 0)