Re: [PATCH v2 4/4] t/helper/test-delta: close fd if fstat() fails after second open()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff King <peff@xxxxxxxx> writes:

> On Tue, Jul 22, 2025 at 04:25:57AM -0400, Jeff King wrote:
>
>> >  	int output_fd = xopen(output_file, O_CREAT | O_WRONLY | O_TRUNC, 0666);
>> >  	if (output_fd != 1) {
>> > -		if (dup2(output_fd, 1) < 0)
>> > +		if (dup2(output_fd, 1) < 0) {
>> >  			close(output_fd);
>> >  			die_errno(_("could not redirect output"));
>> > +		}
>> >  		else
>> >  			close(output_fd);
>> >  	}
>> 
>> Ah, I guess you found the problem from patch 3. But it should have been
>> squashed in there, not to this patch. (But as I said there, I think we
>> should just drop patch 3 entirely).
>
> Er, sorry, I meant patch 2. Counting is hard.

;-)

Thanks for taking a look on these patches before I wake up, so I
didn't have to ;-)




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux