summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-01-01 12:28:35 +0300
committerAndrei Karas <akaras@inbox.ru>2014-01-01 12:43:56 +0300
commit9fc83299bfb029328f19671efae42a7f4b4d465a (patch)
tree5b4ebdad73b787c2b196a10a4903b51d997bc76f /src/utils
parent7e5386bc62f1f61d3409219292e1ec0d71cbd28e (diff)
downloadmanaplus-9fc83299bfb029328f19671efae42a7f4b4d465a.tar.gz
manaplus-9fc83299bfb029328f19671efae42a7f4b4d465a.tar.bz2
manaplus-9fc83299bfb029328f19671efae42a7f4b4d465a.tar.xz
manaplus-9fc83299bfb029328f19671efae42a7f4b4d465a.zip
add in renameFile function support for nacl.
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/files.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/utils/files.cpp b/src/utils/files.cpp
index cb43ff5df..216a83991 100644
--- a/src/utils/files.cpp
+++ b/src/utils/files.cpp
@@ -126,6 +126,7 @@ void Files::extractZip(const std::string &restrict zipName,
int Files::renameFile(const std::string &restrict srcName,
const std::string &restrict dstName)
{
+#if defined __native_client__
FILE *srcFile = fopen(srcName.c_str(), "rb");
if (srcFile == nullptr)
return -1;
@@ -158,4 +159,7 @@ int Files::renameFile(const std::string &restrict srcName,
return 0;
return -1;
+#else
+ return ::rename(srcName.c_str(), dstName.c_str());
+#endif
}