From c2f7ae98d3c321a615cda6946443f5098d9d08bd Mon Sep 17 00:00:00 2001 From: Dan Sagunov Date: Sat, 2 Nov 2013 00:01:15 +0400 Subject: Adding renameFile function for NaCl --- src/net/download.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/net') diff --git a/src/net/download.cpp b/src/net/download.cpp index 3ccff63c8..38b8d2873 100644 --- a/src/net/download.cpp +++ b/src/net/download.cpp @@ -39,6 +39,10 @@ ((LIBCURL_VERSION_MAJOR == (a)) && (LIBCURL_VERSION_MINOR == (b)) && \ (LIBCURL_VERSION_PATCH >= (c)))) +#if defined __native_client__ +#include "utils/files.h" +#endif + #include "debug.h" const char *DOWNLOAD_ERROR_MESSAGE_THREAD @@ -360,7 +364,12 @@ int Download::downloadThread(void *ptr) if (!d->mOptions.cancel) { ::remove(d->mFileName.c_str()); - ::rename(outFilename.c_str(), d->mFileName.c_str()); +#if defined __native_client__ + Files::renameFile( +#else + ::rename( +#endif + outFilename.c_str(), d->mFileName.c_str()); // Check if we can open it and no errors were encountered // during renaming -- cgit v1.2.3-70-g09d2