am: ignore return value of write_file()
write_file() either returns 0 or dies, so there is no point in checking its return value. The callers of the wrappers write_state_text(), write_state_count() and write_state_bool() consequently already ignore their return values. Stop pretending we care and make them void. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
aabbd3f3c9
commit
1dad879a7b
22
builtin/am.c
22
builtin/am.c
@ -183,22 +183,22 @@ static inline const char *am_path(const struct am_state *state, const char *path
|
|||||||
/**
|
/**
|
||||||
* For convenience to call write_file()
|
* For convenience to call write_file()
|
||||||
*/
|
*/
|
||||||
static int write_state_text(const struct am_state *state,
|
static void write_state_text(const struct am_state *state,
|
||||||
const char *name, const char *string)
|
const char *name, const char *string)
|
||||||
{
|
{
|
||||||
return write_file(am_path(state, name), "%s", string);
|
write_file(am_path(state, name), "%s", string);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int write_state_count(const struct am_state *state,
|
static void write_state_count(const struct am_state *state,
|
||||||
|
const char *name, int value)
|
||||||
|
{
|
||||||
|
write_file(am_path(state, name), "%d", value);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void write_state_bool(const struct am_state *state,
|
||||||
const char *name, int value)
|
const char *name, int value)
|
||||||
{
|
{
|
||||||
return write_file(am_path(state, name), "%d", value);
|
write_state_text(state, name, value ? "t" : "f");
|
||||||
}
|
|
||||||
|
|
||||||
static int write_state_bool(const struct am_state *state,
|
|
||||||
const char *name, int value)
|
|
||||||
{
|
|
||||||
return write_state_text(state, name, value ? "t" : "f");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user