Merge pull request #3495 from YJSoft/fix/3494

fix #3494 platform_file_copy always return false on posix
This commit is contained in:
Ted John 2016-05-05 09:20:19 +01:00
commit d8068a48f0
1 changed files with 4 additions and 4 deletions

View File

@ -579,11 +579,11 @@ bool platform_file_copy(const utf8 *srcPath, const utf8 *dstPath, bool overwrite
if (dstFile == NULL) {
if (errno == EEXIST) {
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);
return 0;
return false;
}
// 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) {
fclose(dstFile);
log_error("Could not open source file %s for copying", srcPath);
return 0;
return false;
}
size_t amount_read = 0;
@ -605,7 +605,7 @@ bool platform_file_copy(const utf8 *srcPath, const utf8 *dstPath, bool overwrite
fclose(dstFile);
free(buffer);
return 0;
return true;
}
bool platform_file_move(const utf8 *srcPath, const utf8 *dstPath)