aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc/stdio/rename.c
diff options
context:
space:
mode:
authorMarkus Eisenmann <markus.eisenmann@outlook.com>2025-01-16 15:13:54 +0100
committerCorinna Vinschen <corinna@vinschen.de>2025-01-17 14:07:23 +0100
commit5ee0e96939e8784d4cbd2b2896b0ffbf88a00d86 (patch)
tree40d03fe2e81413e940815f2a29b71ddd0a2c1cf7 /newlib/libc/stdio/rename.c
parent0813644661e3a2f6f00e7e51922ecbb02c79506a (diff)
downloadnewlib-5ee0e96939e8784d4cbd2b2896b0ffbf88a00d86.zip
newlib-5ee0e96939e8784d4cbd2b2896b0ffbf88a00d86.tar.gz
newlib-5ee0e96939e8784d4cbd2b2896b0ffbf88a00d86.tar.bz2
Fixes compile failure if REENTRANT_SYSCALLS_PROVIDED and MISSING_SYSCALL_NAMES defined
If the macros REENTRANT_SYSCALLS_PROVIDED and MISSING_SYSCALL_NAMES are defined some _reent_*-functions are replaced by the system-call and this leads to compile-warning or a runtime-failure. * newlib/libc/stdio/fopen.c _open_r is replaces by open(), declared in <fcntl.h> * newlib/libc/stdio64/fopen64.c ditto * newlib/libc/stdio/rename.c _rename_r is rename() itself; i.e, fix recursion
Diffstat (limited to 'newlib/libc/stdio/rename.c')
-rw-r--r--newlib/libc/stdio/rename.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/newlib/libc/stdio/rename.c b/newlib/libc/stdio/rename.c
index 16ef3e3..9abc0d3 100644
--- a/newlib/libc/stdio/rename.c
+++ b/newlib/libc/stdio/rename.c
@@ -51,7 +51,8 @@ Supporting OS subroutines required: <<link>>, <<unlink>>, or <<rename>>.
#include <stdio.h>
#include <sys/unistd.h>
-#ifndef _REENT_ONLY
+#if !defined(_REENT_ONLY) && !( \
+ defined(REENTRANT_SYSCALLS_PROVIDED) && defined(MISSING_SYSCALL_NAMES))
int
rename (const char *old,