diff options
| author | Junio C Hamano <gitster@pobox.com> | 2023-02-24 11:32:30 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2023-02-24 11:32:30 -0800 |
| commit | deb32d6d6024bbfc41408893f122dab2ed947c34 (patch) | |
| tree | c714364b427d488a0e0e139c5ec93d940bfcfc60 | |
| parent | Merge branch 'rd/doc-default-date-format' (diff) | |
| parent | test-genzeros: avoid raw write(2) (diff) | |
| download | git-deb32d6d6024bbfc41408893f122dab2ed947c34.tar.gz git-deb32d6d6024bbfc41408893f122dab2ed947c34.zip | |
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)
| -rw-r--r-- | t/helper/test-genzeros.c | 11 |
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; } |
