EM_DEBUG_LOG_SEC("src_file[%s], dst_file[%s]", src_file, dst_file);
if (strcmp(src_file, dst_file) != 0) {
- if (rename(src_file, dst_file) != 0) {
- /* EM_DEBUG_EXCEPTION("%s", strerror(errno)); */
- if (errno == EXDEV) { /* oldpath and newpath are not on the same mounted file system. (Linux permits a file system to be mounted at multiple points, but rename() */
- /* does not work across different mount points, even if the same file system is mounted on both.) */
EM_DEBUG_LOG("oldpath and newpath are not on the same mounted file system.");
if (!emstorage_copy_file(src_file, dst_file, sync_status, &error)) {
EM_DEBUG_EXCEPTION("emstorage_copy_file failed - %d", error);
- goto FINISH_OFF;
- }
- remove(src_file);
- EM_DEBUG_LOG("src[%s] removed", src_file);
- } else {
- if (errno == ENOENT) {
+
struct stat temp_file_stat;
if (stat(src_file, &temp_file_stat) < 0) {
EM_DEBUG_EXCEPTION("no src file found [%s] : %s", src_file, EM_STRERROR(errno_buf));
error = EMAIL_ERROR_FILE_NOT_FOUND;
goto FINISH_OFF;
- } else {
- EM_DEBUG_EXCEPTION("rename failed: %s", EM_STRERROR(errno_buf));
- error = EMAIL_ERROR_SYSTEM_FAILURE;
- goto FINISH_OFF;
+
+
}
- }
- }
+ remove(src_file);
+ EM_DEBUG_LOG("src[%s] removed", src_file);
} else {
EM_DEBUG_LOG("src[%s] = dst[%s]", src_file, dst_file);
}