xread/xwrite: do not worry about EINTR at calling sites.
[git.git] / mktag.c
diff --git a/mktag.c b/mktag.c
index 585677e..fc6a9bf 100644 (file)
--- a/mktag.c
+++ b/mktag.c
@@ -111,17 +111,14 @@ int main(int argc, char **argv)
        if (argc != 1)
                usage("cat <signaturefile> | git-mktag");
 
+       setup_git_directory();
+
        // Read the signature
        size = 0;
        for (;;) {
-               int ret = read(0, buffer + size, MAXSIZE - size);
-               if (!ret)
-                       break;
-               if (ret < 0) {
-                       if (errno == EAGAIN)
-                               continue;
+               int ret = xread(0, buffer + size, MAXSIZE - size);
+               if (ret <= 0)
                        break;
-               }
                size += ret;
        }