diff options
author | Antony Dovgal <tony2001@php.net> | 2006-02-08 20:50:03 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2006-02-08 20:50:03 +0000 |
commit | 1f8b32067945a69c2bd429811a81e7b6d21549a5 (patch) | |
tree | 19809d717d369d6c7af48e08534b27ae1b2dafe7 /TSRM | |
parent | 39a4a46ae48720d2e3841d363cca65cd0ab374aa (diff) | |
download | php-git-1f8b32067945a69c2bd429811a81e7b6d21549a5.tar.gz |
MFH: move function definition from .h to .c, where it should be
Diffstat (limited to 'TSRM')
-rw-r--r-- | TSRM/tsrm_virtual_cwd.c | 20 | ||||
-rw-r--r-- | 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 4ab511f313..a7ce9d29c4 100644 --- a/TSRM/tsrm_virtual_cwd.c +++ b/TSRM/tsrm_virtual_cwd.c @@ -1035,6 +1035,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 362659bc9d..9c1b9d2f0a 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 |