submodule--helper, module_clone: catch fprintf failure
The return value of fprintf is unchecked, which may lead to unreported errors. Use fprintf_or_die to report the error to the user. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
1ea4d9b7c8
commit
1f15ba1f3c
@ -229,7 +229,7 @@ static int module_clone(int argc, const char **argv, const char *prefix)
|
|||||||
if (!submodule_dot_git)
|
if (!submodule_dot_git)
|
||||||
die_errno(_("cannot open file '%s'"), sb.buf);
|
die_errno(_("cannot open file '%s'"), sb.buf);
|
||||||
|
|
||||||
fprintf(submodule_dot_git, "gitdir: %s\n",
|
fprintf_or_die(submodule_dot_git, "gitdir: %s\n",
|
||||||
relative_path(sm_gitdir, path, &rel_path));
|
relative_path(sm_gitdir, path, &rel_path));
|
||||||
if (fclose(submodule_dot_git))
|
if (fclose(submodule_dot_git))
|
||||||
die(_("could not close file %s"), sb.buf);
|
die(_("could not close file %s"), sb.buf);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user