Thread (181 messages) 181 messages, 5 authors, 2019-03-13

Re: [PATCH 08/15] sequencer: change complete_action() to use the refactored functions

From: Alban Gruin <hidden>
Date: 2018-10-11 17:06:27

Le 11/10/2018 à 15:51, Phillip Wood a écrit :
On 07/10/2018 20:54, Alban Gruin wrote:
quoted
+    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.
Best Wishes

Phillip
Cheers,
Alban
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help