Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-08-24 23:03:07 +0300
committerJunio C Hamano <gitster@pobox.com>2015-08-24 23:09:02 +0300
commit12d6ce1dba504dfc5279b8d24da3edb4865c2820 (patch)
treeb986a6e22bf290aa4f74d566169a6d54db6e4f3f /builtin/am.c
parent57c867efe4e005e40cfdee8a64550d7a95bbb9a0 (diff)
write_file(): drop "fatal" parameter
All callers except three passed 1 for the "fatal" parameter to ask this function to die upon error, but to a casual reader of the code, it was not all obvious what that 1 meant. Instead, split the function into two based on a common write_file_v() that takes the flag, introduce write_file_gently() as a new way to attempt creating a file without dying on error, and make three callers to call it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/am.c')
-rw-r--r--builtin/am.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/am.c b/builtin/am.c
index f0a046bdc0..9c576779c3 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -205,13 +205,13 @@ static int write_state_text(const struct am_state *state,
fmt = "%s\n";
else
fmt = "%s";
- return write_file(am_path(state, name), 1, fmt, string);
+ return write_file(am_path(state, name), fmt, string);
}
static int write_state_count(const struct am_state *state,
const char *name, int value)
{
- return write_file(am_path(state, name), 1, "%d\n", value);
+ return write_file(am_path(state, name), "%d\n", value);
}
static int write_state_bool(const struct am_state *state,