Use rpl_ prefix for functions, so as to avoid endless recursions in weird cases.
authorBruno Haible <bruno@clisp.org>
Mon, 15 Oct 2007 20:40:19 +0000 (22:40 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 15 Oct 2007 20:40:19 +0000 (22:40 +0200)
ChangeLog
lib/fchdir.c
lib/fopen.c
lib/freopen.c
lib/iconv.c
lib/iconv_close.c

index 4db436e..b43aa0f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-10-15  Bruno Haible  <bruno@clisp.org>
+
+       * lib/fchdir.c (close, open, closedir, opendir, dup, dup2): Define
+       with explicit rpl_ prefix.
+       * lib/fopen.c (fopen): Likewise.
+       * lib/freopen.c (freopen): Likewise.
+       * lib/iconv.c (iconv): Likewise.
+       * lib/iconv_close.c (iconv_close): Likewise.
+
 2007-10-15  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * m4/iconv_open (gl_FUNC_ICONV_OPEN_UTF): Fix cache variable name.
 2007-10-15  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * m4/iconv_open (gl_FUNC_ICONV_OPEN_UTF): Fix cache variable name.
index 24e6992..246987c 100644 (file)
@@ -78,7 +78,7 @@ ensure_dirs_slot (size_t fd)
 /* Override open() and close(), to keep track of the open file descriptors.  */
 
 int
 /* Override open() and close(), to keep track of the open file descriptors.  */
 
 int
-close (int fd)
+rpl_close (int fd)
 #undef close
 {
   int retval = close (fd);
 #undef close
 {
   int retval = close (fd);
@@ -94,7 +94,7 @@ close (int fd)
 }
 
 int
 }
 
 int
-open (const char *filename, int flags, ...)
+rpl_open (const char *filename, int flags, ...)
 #undef open
 {
   mode_t mode;
 #undef open
 {
   mode_t mode;
@@ -139,7 +139,7 @@ open (const char *filename, int flags, ...)
    descriptors.  Needed because there is a function dirfd().  */
 
 int
    descriptors.  Needed because there is a function dirfd().  */
 
 int
-closedir (DIR *dp)
+rpl_closedir (DIR *dp)
 #undef closedir
 {
   int fd = dirfd (dp);
 #undef closedir
 {
   int fd = dirfd (dp);
@@ -156,7 +156,7 @@ closedir (DIR *dp)
 }
 
 DIR *
 }
 
 DIR *
-opendir (const char *filename)
+rpl_opendir (const char *filename)
 #undef opendir
 {
   DIR *dp;
 #undef opendir
 {
   DIR *dp;
@@ -182,7 +182,7 @@ opendir (const char *filename)
 /* Override dup() and dup2(), to keep track of open file descriptors.  */
 
 int
 /* Override dup() and dup2(), to keep track of open file descriptors.  */
 
 int
-dup (int oldfd)
+rpl_dup (int oldfd)
 #undef dup
 {
   int newfd = dup (oldfd);
 #undef dup
 {
   int newfd = dup (oldfd);
@@ -217,7 +217,7 @@ dup (int oldfd)
 }
 
 int
 }
 
 int
-dup2 (int oldfd, int newfd)
+rpl_dup2 (int oldfd, int newfd)
 #undef dup2
 {
   int retval = dup2 (oldfd, newfd);
 #undef dup2
 {
   int retval = dup2 (oldfd, newfd);
index fd5564c..14b65ca 100644 (file)
@@ -24,7 +24,7 @@
 #include <string.h>
 
 FILE *
 #include <string.h>
 
 FILE *
-fopen (const char *filename, const char *mode)
+rpl_fopen (const char *filename, const char *mode)
 #undef fopen
 {
 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
 #undef fopen
 {
 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
index d36ec5c..5942bb0 100644 (file)
@@ -24,7 +24,7 @@
 #include <string.h>
 
 FILE *
 #include <string.h>
 
 FILE *
-freopen (const char *filename, const char *mode, FILE *stream)
+rpl_freopen (const char *filename, const char *mode, FILE *stream)
 #undef freopen
 {
 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
 #undef freopen
 {
 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
index 2abfff8..ced09f2 100644 (file)
@@ -275,9 +275,9 @@ utf32le_wctomb (unsigned char *r, ucs4_t wc, size_t n)
 #endif
 
 size_t
 #endif
 
 size_t
-iconv (iconv_t cd,
-       ICONV_CONST char **inbuf, size_t *inbytesleft,
-       char **outbuf, size_t *outbytesleft)
+rpl_iconv (iconv_t cd,
+          ICONV_CONST char **inbuf, size_t *inbytesleft,
+          char **outbuf, size_t *outbytesleft)
 #undef iconv
 {
 #if REPLACE_ICONV_UTF
 #undef iconv
 {
 #if REPLACE_ICONV_UTF
index 11b92d9..261898e 100644 (file)
@@ -26,7 +26,7 @@
 #endif
 
 int
 #endif
 
 int
-iconv_close (iconv_t cd)
+rpl_iconv_close (iconv_t cd)
 #undef iconv_close
 {
 #if REPLACE_ICONV_UTF
 #undef iconv_close
 {
 #if REPLACE_ICONV_UTF