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>

René Scharfe committed Jul 8, 2016 at 05:08 UTC 1dad879a7b7b41381cf4ccf471dcab06993a131b
1 file changed +9 -9
builtin/am.c
+9 -9
@@ -183,22 +183,22 @@ static inline const char *am_path(const struct am_state *state, const char *path
183 /**
184 * For convenience to call write_file()
185 */
186 -static int write_state_text(const struct am_state *state,
187 - const char *name, const char *string)
186 +static void write_state_text(const struct am_state *state,
187 + const char *name, const char *string)
188 {
189 - return write_file(am_path(state, name), "%s", string);
189 + write_file(am_path(state, name), "%s", string);
190 }
191
192 -static int write_state_count(const struct am_state *state,
193 - const char *name, int value)
192 +static void write_state_count(const struct am_state *state,
193 + const char *name, int value)
194 {
195 - return write_file(am_path(state, name), "%d", value);
195 + write_file(am_path(state, name), "%d", value);
196 }
197
198 -static int write_state_bool(const struct am_state *state,
199 - const char *name, int value)
198 +static void write_state_bool(const struct am_state *state,
199 + const char *name, int value)
200 {
201 - return write_state_text(state, name, value ? "t" : "f");
201 + write_state_text(state, name, value ? "t" : "f");
202 }
203
204 /**