short i/o: fix calls to write to use xwrite or write_in_full
[gitweb.git] / commit.c
index 2a58175aca16dc211cdf5a380e82bc9c0f4d1326..9ce45cec25d80bab22ba7267a6e2a58318ac3eeb 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -249,8 +249,10 @@ int write_shallow_commits(int fd, int use_pack_protocol)
                        if (use_pack_protocol)
                                packet_write(fd, "shallow %s", hex);
                        else {
-                               write(fd, hex,  40);
-                               write(fd, "\n", 1);
+                               if (write_in_full(fd, hex,  40) != 40)
+                                       break;
+                               if (write_in_full(fd, "\n", 1) != 1)
+                                       break;
                        }
                }
        return count;