From 4f04d45a0eebe2618e88163d6a8765d180d7c866 Mon Sep 17 00:00:00 2001 From: Markus Mittendrein Date: Thu, 14 Mar 2019 13:01:53 +0100 Subject: Fix removing of tmpfile on windows (at least in wine) --- src/cc4group.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/cc4group.c') diff --git a/src/cc4group.c b/src/cc4group.c index 368b6aa..dd926f3 100644 --- a/src/cc4group.c +++ b/src/cc4group.c @@ -256,12 +256,6 @@ static void* cc4group_createTmpMemoryFile(CC4Group* const this, const size_t siz return NULL; } - if(unlink(TMP_FILE) == -1) - { - fprintf(stderr, "WARNING: unlink: Failed to delete tmp file \"" TMP_FILE "\". Manual deletion is required: %s\n", strerror(errno)); - } -#undef TMP_FILE - void* mmapExtra; ret = cc4group_mapSizedWriteFd(this, tmpFile, size, &mmapExtra); if(ret == MAP_FAILED) @@ -293,6 +287,12 @@ static void* cc4group_createTmpMemoryFile(CC4Group* const this, const size_t siz return NULL; } + if(unlink(TMP_FILE) == -1) + { + fprintf(stderr, "WARNING: unlink: Failed to delete tmp file \"" TMP_FILE "\". Manual deletion is required: %s\n", strerror(errno)); + } +#undef TMP_FILE + return ret; } -- cgit v1.2.3-54-g00ecf