Re: [PATCH 08/15] sequencer: change complete_action() to use the refactored functions
- From
Alban Gruin <alban.gruin@gmail.com>
- Date
- Oct 11, 2018, 17:06 UTC
- Message-ID
- <d14281c1-6beb-50fe-e9aa-3d8555aa307d@gmail.com>
- In-Reply-To
- <d0adf861-3046-f0b6-3217-c89d92319e43@talktalk.net>
Le 11/10/2018 à 15:51, Phillip Wood a écrit :
Show 12 quoted lines
> On 07/10/2018 20:54, Alban Gruin wrote:
>> + if (rewrite_file(todo_file, new_todo.buf.buf, new_todo.buf.len) <
>> 0) {
>> + todo_list_release(&new_todo);
>> + return error_errno(_("could not write '%s'"), todo_file);
>> + }
>
> rewrite_file() can truncate the old version of the file if there is an
> error when writing the new version, I think it would be better to use
> write_message() instead as that atomically updates the file. The same
> applies to patch 5 (refactor rearrange_squash()) after which I think
> there will be no callers to rewrite_file() so it can be deleted.You’re right, I didn’t notice that.
Show 5 quoted lines
> > Best Wishes > > Phillip >
Cheers, Alban