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.
Diff: common/retarget.cpp
- Revision:
- 284:859ffaa7c331
- Parent:
- 269:0e58554f11d5
- Child:
- 285:31249416b6f9
diff -r bf0f62a62bf4 -r 859ffaa7c331 common/retarget.cpp --- 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) {