mirror of https://github.com/OpenRCT2/OpenRCT2.git
fix #3494 platform_file_copy always return false on posix
This commit is contained in:
parent
0a710d3a01
commit
f3c1762a5a
|
@ -579,11 +579,11 @@ bool platform_file_copy(const utf8 *srcPath, const utf8 *dstPath, bool overwrite
|
||||||
if (dstFile == NULL) {
|
if (dstFile == NULL) {
|
||||||
if (errno == EEXIST) {
|
if (errno == EEXIST) {
|
||||||
log_warning("platform_file_copy: Not overwriting %s, because overwrite flag == false", dstPath);
|
log_warning("platform_file_copy: Not overwriting %s, because overwrite flag == false", dstPath);
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
log_error("Could not open destination file %s for copying", dstPath);
|
log_error("Could not open destination file %s for copying", dstPath);
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Open both files and check whether they are opened correctly
|
// Open both files and check whether they are opened correctly
|
||||||
|
@ -591,7 +591,7 @@ bool platform_file_copy(const utf8 *srcPath, const utf8 *dstPath, bool overwrite
|
||||||
if (srcFile == NULL) {
|
if (srcFile == NULL) {
|
||||||
fclose(dstFile);
|
fclose(dstFile);
|
||||||
log_error("Could not open source file %s for copying", srcPath);
|
log_error("Could not open source file %s for copying", srcPath);
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t amount_read = 0;
|
size_t amount_read = 0;
|
||||||
|
@ -605,7 +605,7 @@ bool platform_file_copy(const utf8 *srcPath, const utf8 *dstPath, bool overwrite
|
||||||
fclose(dstFile);
|
fclose(dstFile);
|
||||||
free(buffer);
|
free(buffer);
|
||||||
|
|
||||||
return 0;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool platform_file_move(const utf8 *srcPath, const utf8 *dstPath)
|
bool platform_file_move(const utf8 *srcPath, const utf8 *dstPath)
|
||||||
|
|
Loading…
Reference in New Issue