cvs: TSRM / tsrm_virtual_cwd.c tsrm_virtual_cwd.h

From: Date: Wed, 08 Feb 2006 20:49:40 +0000
Subject: cvs: TSRM / tsrm_virtual_cwd.c tsrm_virtual_cwd.h
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-4576@lists.php.net to get a copy of this message
tony2001 Wed Feb 8 20:49:40 2006 UTC Modified files: /TSRM tsrm_virtual_cwd.c tsrm_virtual_cwd.h Log: move function definition from .h to .c, where it should be http://cvs.php.net/viewcvs.cgi/TSRM/tsrm_virtual_cwd.c?r1=1.81&r2=1.82&diff_format=u Index: TSRM/tsrm_virtual_cwd.c diff -u TSRM/tsrm_virtual_cwd.c:1.81 TSRM/tsrm_virtual_cwd.c:1.82 --- TSRM/tsrm_virtual_cwd.c:1.81 Mon Feb 6 20:36:51 2006 +++ TSRM/tsrm_virtual_cwd.c Wed Feb 8 20:49:40 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: tsrm_virtual_cwd.c,v 1.81 2006/02/06 20:36:51 tony2001 Exp $ */ +/* $Id: tsrm_virtual_cwd.c,v 1.82 2006/02/08 20:49:40 tony2001 Exp $ */ #include <sys/types.h> #include <sys/stat.h> @@ -1043,6 +1043,26 @@ #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: http://cvs.php.net/viewcvs.cgi/TSRM/tsrm_virtual_cwd.h?r1=1.51&r2=1.52&diff_format=u Index: TSRM/tsrm_virtual_cwd.h diff -u TSRM/tsrm_virtual_cwd.h:1.51 TSRM/tsrm_virtual_cwd.h:1.52 --- TSRM/tsrm_virtual_cwd.h:1.51 Mon Jan 16 09:17:50 2006 +++ TSRM/tsrm_virtual_cwd.h Wed Feb 8 20:49:40 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: tsrm_virtual_cwd.h,v 1.51 2006/01/16 09:17:50 dmitry Exp $ */ +/* $Id: tsrm_virtual_cwd.h,v 1.52 2006/02/08 20:49:40 tony2001 Exp $ */ #ifndef VIRTUAL_CWD_H #define VIRTUAL_CWD_H @@ -166,23 +166,8 @@ #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

« previous php.zend-engine.cvs (#4576) next »