mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-30 12:50:58 +00:00
Properly override rename on Newlib
Newlib implements rename as _link and _unlink, not _rename. There is no _link on either SLFS or SPIFFS, so override rename directly. PUBLISHED_FROM=ebb54664f8a3c8664ecab1fac021bef286a0e230
This commit is contained in:
1 parent
6f7f774080
commit
459cd1b095
1 file changed
+4
-9
+4
-9
@@ -10178,11 +10178,11 @@ ssize_t _write(int fd, const void *buf, size_t count) {
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if MG_TI_NO_HOST_INTERFACE
|
/*
|
||||||
|
* On Newlib we override rename directly too, because the default
|
||||||
|
* implementation using _link and _unlink doesn't work for us.
|
||||||
|
*/
|
||||||
int rename(const char *from, const char *to) {
|
int rename(const char *from, const char *to) {
|
||||||
#else
|
|
||||||
int _rename(const char *from, const char *to) {
|
|
||||||
#endif
|
|
||||||
int r = -1;
|
int r = -1;
|
||||||
from = drop_dir(from);
|
from = drop_dir(from);
|
||||||
to = drop_dir(to);
|
to = drop_dir(to);
|
||||||
@@ -10199,11 +10199,6 @@ int _rename(const char *from, const char *to) {
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
int _link(const char *from, const char *to) {
|
|
||||||
DBG(("link(%s, %s)", from, to));
|
|
||||||
return set_errno(ENOTSUP);
|
|
||||||
}
|
|
||||||
|
|
||||||
#if MG_TI_NO_HOST_INTERFACE
|
#if MG_TI_NO_HOST_INTERFACE
|
||||||
int unlink(const char *filename) {
|
int unlink(const char *filename) {
|
||||||
#else
|
#else
|
||||||
|
|||||||
Reference in new issue
Block a user