From 1e7f1f753f239f071e195d49a6c05963b09f9b42 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 12 Jun 2008 16:29:00 +0000 Subject: [PATCH] When your home directory is full, saving defaults would fail without raising an error. checked all others instances of BLO_write_file give errors too. When autosave fails it reports an error in the console so its not too annoying. --- source/blender/src/usiblender.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/source/blender/src/usiblender.c b/source/blender/src/usiblender.c index 6c0838288b8..5ac8e186b68 100644 --- a/source/blender/src/usiblender.c +++ b/source/blender/src/usiblender.c @@ -925,7 +925,7 @@ void BIF_write_file(char *target) writeBlog(); } else { - error("%s", err); + error("failed to write blend file: %s", err); } waitcursor(0); @@ -940,7 +940,10 @@ void BIF_write_homefile(void) /* force save as regular blend file */ write_flags = G.fileflags & ~(G_FILE_COMPRESS | G_FILE_LOCK | G_FILE_SIGN); - BLO_write_file(tstr, write_flags, &err); + + if (!BLO_write_file(tstr, write_flags, &err)) { + error("failed writing defaults: %s", err); + } } void BIF_write_autosave(void) @@ -952,7 +955,9 @@ void BIF_write_autosave(void) /* force save as regular blend file */ write_flags = G.fileflags & ~(G_FILE_COMPRESS | G_FILE_LOCK | G_FILE_SIGN); - BLO_write_file(tstr, write_flags, &err); + if (!BLO_write_file(tstr, write_flags, &err)) { + fprintf(stderr, "failed to write autosave: %s\n", err); /* using error(...) is too annoying here */ + } } /* remove temp files assosiated with this blend file when quitting, loading or saving in a new path */