summaryrefslogtreecommitdiff
path: root/t/helper/test-truncate.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-08-03 18:44:27 -0700
committerJunio C Hamano <gitster@pobox.com>2025-08-03 18:44:27 -0700
commit750a95ba3fa8a7d1c48a6c2eae535b09dda68aa0 (patch)
treebe0fa7654c56e17706e315fa273f3e93ad521591 /t/helper/test-truncate.c
parentf61d8ce526e2aca24ba5dace0ca25bee67051ff1 (diff)
parent0f1b33815b553dd457f8e38e3768b73cf9227082 (diff)
Merge branch 'hl/test-helper-fd-close'
A few file descriptors left unclosed upon program completion in a few test helper programs are now closed. * hl/test-helper-fd-close: test-delta: close output descriptor after use test-delta: use strbufs to hold input files test-delta: handle errors with die() t/helper/test-truncate: close file descriptor after truncation
Diffstat (limited to 't/helper/test-truncate.c')
-rw-r--r--t/helper/test-truncate.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/t/helper/test-truncate.c b/t/helper/test-truncate.c
index 3931deaec7..2820cc7ed7 100644
--- a/t/helper/test-truncate.c
+++ b/t/helper/test-truncate.c
@@ -21,5 +21,8 @@ int cmd__truncate(int argc, const char **argv)
if (ftruncate(fd, (off_t) sz) < 0)
die_errno("failed to truncate file");
+
+ close(fd);
+
return 0;
}