Re: [PATCH v2 1/2] t: add a test helper to truncate files
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 12, 2023, 22:52 UTC
- Message-ID
- <xmqqsf6f312s.fsf@gitster.g>
- In-Reply-To
- <20231012160930.330618-2-sandals@crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
> + fd = open(argv[1], O_WRONLY | O_CREAT, 0600);
> + if (fd < 0)
> + die_errno("failed to open file %s", argv[1]);contrib/coccinelle/xopen.cocci tells us to write this simply as
fd = xopen(argv[1], O_WRONLY | O_CREAT, 0600);
https://github.com/git/git/actions/runs/6500777388/job/17656837393#step:4:657