From 12d6ce1dba504dfc5279b8d24da3edb4865c2820 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 24 Aug 2015 13:03:07 -0700 Subject: 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 --- setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setup.c') diff --git a/setup.c b/setup.c index 5f9f07dcdb..feb85651ef 100644 --- a/setup.c +++ b/setup.c @@ -404,7 +404,7 @@ static void update_linked_gitdir(const char *gitfile, const char *gitdir) strbuf_addf(&path, "%s/gitfile", gitdir); if (stat(path.buf, &st) || st.st_mtime + 24 * 3600 < time(NULL)) - write_file(path.buf, 0, "%s\n", gitfile); + write_file_gently(path.buf, "%s\n", gitfile); strbuf_release(&path); } -- cgit v1.2.1