aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fast-import.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fast-import.c b/fast-import.c
index d9ed3e2f1..face9bba3 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -1367,8 +1367,12 @@ static void dump_marks(void)
if (mark_file)
{
FILE *f = fopen(mark_file, "w");
- dump_marks_helper(f, 0, marks);
- fclose(f);
+ if (f) {
+ dump_marks_helper(f, 0, marks);
+ fclose(f);
+ } else
+ failure |= error("Unable to write marks file %s: %s",
+ mark_file, strerror(errno));
}
}