From f4cebea207ff173f6d2cf983ba86ca588726adca Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 4 Jan 2011 10:28:37 +0000 Subject: print a message if the file cant be removed, may help narrow down why there are problems with MSVC at the moment. --- source/blender/makesrna/intern/makesrna.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 534c63fca9b..c88b423ca49 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -68,7 +68,16 @@ static int replace_if_different(char *tmpfile, const char *dep_files[]) // return 0; // use for testing had edited rna #define REN_IF_DIFF \ - remove(orgfile); \ + { \ + FILE *file_test= fopen(orgfile, "rb"); \ + if(file_test) { \ + fclose(file_test); \ + if(remove(orgfile) != 0) { \ + fprintf(stderr, "%s:%d, Remove Error (%s): \"%s\"\n", __FILE__, __LINE__, strerror(errno), orgfile); \ + return -1; \ + } \ + } \ + } \ if(rename(tmpfile, orgfile) != 0) { \ fprintf(stderr, "%s:%d, Rename Error (%s): \"%s\" -> \"%s\"\n", __FILE__, __LINE__, strerror(errno), tmpfile, orgfile); \ return -1; \ -- cgit v1.2.3