Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-02-24 22:32:30 +0300
committerJunio C Hamano <gitster@pobox.com>2023-02-24 22:32:30 +0300
commitdeb32d6d6024bbfc41408893f122dab2ed947c34 (patch)
treec714364b427d488a0e0e139c5ec93d940bfcfc60 /t
parenta7981d071792234e30d892f3c675df802538f443 (diff)
parent58eab6ff13924edd156d45bd8e0a947b8f8e07e9 (diff)
Merge branch 'jc/genzeros-avoid-raw-write'
A test helper had a single write(2) of 256kB, which was too big for some platforms (e.g. NonStop), which has been corrected by using xwrite() wrapper appropriately. * jc/genzeros-avoid-raw-write: test-genzeros: avoid raw write(2)
Diffstat (limited to 't')
-rw-r--r--t/helper/test-genzeros.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/t/helper/test-genzeros.c b/t/helper/test-genzeros.c
index 8ca988d621..47af843b68 100644
--- a/t/helper/test-genzeros.c
+++ b/t/helper/test-genzeros.c
@@ -17,15 +17,16 @@ int cmd__genzeros(int argc, const char **argv)
/* Writing out individual NUL bytes is slow... */
while (count < 0)
- if (write(1, zeros, ARRAY_SIZE(zeros)) < 0)
- return -1;
+ if (xwrite(1, zeros, ARRAY_SIZE(zeros)) < 0)
+ die_errno("write error");
while (count > 0) {
- n = write(1, zeros, count < ARRAY_SIZE(zeros) ?
- count : ARRAY_SIZE(zeros));
+ n = xwrite(1, zeros,
+ count < ARRAY_SIZE(zeros)
+ ? count : ARRAY_SIZE(zeros));
if (n < 0)
- return -1;
+ die_errno("write error");
count -= n;
}