From 73610b76a9374509638a7011970807afed8b6bb9 Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Wed, 8 Feb 2006 20:49:40 +0000 Subject: [PATCH] move function definition from .h to .c, where it should be --- TSRM/tsrm_virtual_cwd.c | 20 ++++++++++++++++++++ TSRM/tsrm_virtual_cwd.h | 17 +---------------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/TSRM/tsrm_virtual_cwd.c b/TSRM/tsrm_virtual_cwd.c index 61e3e40f02..59a6b81d1d 100644 --- a/TSRM/tsrm_virtual_cwd.c +++ b/TSRM/tsrm_virtual_cwd.c @@ -1043,6 +1043,26 @@ CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) #endif +/* On AIX & Tru64 when a file does not exist realpath() returns + * NULL, and sets errno to ENOENT. Unlike in other libc implementations + * the destination is not filled and remains undefined. Therefor, we + * must populate it manually using strcpy as done on systems with no + * realpath() function. + */ +#if defined(__osf__) || defined(_AIX) +char *php_realpath_hack(char *src, char *dest) +{ + char *ret; + + if ((ret = realpath(src, dest)) == NULL && errno == ENOENT) { + return strcpy(dest, src); + } else { + return ret; + } +} +#endif + + /* * Local variables: diff --git a/TSRM/tsrm_virtual_cwd.h b/TSRM/tsrm_virtual_cwd.h index cdd99e36f6..5ad435d274 100644 --- a/TSRM/tsrm_virtual_cwd.h +++ b/TSRM/tsrm_virtual_cwd.h @@ -166,23 +166,8 @@ CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC); #endif #endif -/* On AIX & Tru64 when a file does not exist realpath() returns - * NULL, and sets errno to ENOENT. Unlike in other libc implementations - * the destination is not filled and remains undefined. Therefor, we - * must populate it manually using strcpy as done on systems with no - * realpath() function. - */ #if defined(__osf__) || defined(_AIX) -static char *php_realpath_hack(char *src, char *dest) -{ - char *ret; - - if ((ret = realpath(src, dest)) == NULL && errno == ENOENT) { - return strcpy(dest, src); - } else { - return ret; - } -} +char *php_realpath_hack(char *src, char *dest); #endif #if HAVE_UTIME -- 2.40.0