diff options
| author | Markus Mittendrein <git@maxmitti.tk> | 2019-03-14 13:01:53 +0100 |
|---|---|---|
| committer | Markus Mittendrein <git@maxmitti.tk> | 2019-03-14 13:01:53 +0100 |
| commit | 4f04d45a0eebe2618e88163d6a8765d180d7c866 (patch) | |
| tree | 7757471a7d013a3e4e04f6f8187e743fb82d35d1 /src | |
| parent | bd22513c86b7a00c0c25f2cc6f5dfbcf67076da0 (diff) | |
| download | cc4group-4f04d45a0eebe2618e88163d6a8765d180d7c866.tar.gz cc4group-4f04d45a0eebe2618e88163d6a8765d180d7c866.zip | |
Fix removing of tmpfile on windows (at least in wine)
Diffstat (limited to 'src')
| -rw-r--r-- | src/cc4group.c | 12 |
1 files changed, 6 insertions, 6 deletions
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; } |
