mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Files at this revision

API Documentation at this revision

Comitter:
mbed_official
Date:
Wed Aug 13 10:30:07 2014 +0100
Parent:
283:bf0f62a62bf4
Child:
285:31249416b6f9
Commit message:
Synchronized with git revision d076c510609d047f287bc16645c1dd644fc66649

Full URL: https://github.com/mbedmicro/mbed/commit/d076c510609d047f287bc16645c1dd644fc66649/

Changed in this revision

common/retarget.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/common/retarget.cpp	Wed Aug 13 09:00:06 2014 +0100
+++ b/common/retarget.cpp	Wed Aug 13 10:30:07 2014 +0100
@@ -323,7 +323,15 @@
 }
 
 extern "C" int rename(const char *oldname, const char *newname) {
-    return -1;
+    FilePath fpOld(oldname);
+    FilePath fpNew(newname);
+    FileSystemLike *fsOld = fpOld.fileSystem();
+    FileSystemLike *fsNew = fpNew.fileSystem();
+
+    /* rename only if both files are on the same FS */
+    if (fsOld != fsNew || fsOld == NULL) return -1;
+
+    return fsOld->rename(fpOld.fileName(), fpNew.fileName());
 }
 
 extern "C" char *tmpnam(char *s) {