Pádraig Brady <[email protected]> writes:

> On 24/12/2025 05:54, Collin Funk wrote:
>> Looks like this was introduced in commit
>> 50e438972b8f6e4c7486c38beb542539de0298c7.
>> If ftruncate failed, we may set exit_status to EXIT_FAILURE
>> depending
>> on the file type. However, that value would always be overwritten by
>> dd_copy.
>
> Good spot!
>
> I wonder do we want to do the dd_copy() though if the ftruncate failed,
> as we'd be copying data at the wrong offset then?
>
> Perhaps instead we might want:
>
>   if (! exit_status)
>     exit_status = dd_copy ();

Paul, what do you think?

Based on your commit message it seems like you wanted to do the copy as
long as we have the file open [1]?

Collin

[1] 
https://github.com/coreutils/coreutils/commit/50e438972b8f6e4c7486c38beb542539de0298c7

Reply via email to