diff options
| author | Andi Gutmans <andi@php.net> | 2000-09-02 18:40:41 +0000 |
|---|---|---|
| committer | Andi Gutmans <andi@php.net> | 2000-09-02 18:40:41 +0000 |
| commit | 299d1295b6350cc32e33e56d20e1106fe5c93f1a (patch) | |
| tree | 2df9566b5e9065b4766267a551bec742cca128a9 /main/php_virtual_cwd.c | |
| parent | cf8e389799ff213d6eadfee8839b1aaa5ebe32f8 (diff) | |
| download | php-git-299d1295b6350cc32e33e56d20e1106fe5c93f1a.tar.gz | |
- Remove another TSRM->Zend dependency
Diffstat (limited to 'main/php_virtual_cwd.c')
| -rw-r--r-- | main/php_virtual_cwd.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/main/php_virtual_cwd.c b/main/php_virtual_cwd.c index fd0c352bb0..0bb8e34b2c 100644 --- a/main/php_virtual_cwd.c +++ b/main/php_virtual_cwd.c @@ -48,7 +48,11 @@ typedef int mode_t; MUTEX_T cwd_mutex; #endif -ZEND_DECLARE_MODULE_GLOBALS(cwd); +#ifdef ZTS +static ts_rsrc_id cwd_globals_id; +#else +static virtual_cwd_globals cwd_globals; +#endif cwd_state main_cwd_state; /* True global */ @@ -145,12 +149,12 @@ static int php_is_file_ok(const cwd_state *state) return (1); } -static void cwd_globals_ctor(zend_cwd_globals *cwd_globals) +static void cwd_globals_ctor(virtual_cwd_globals *cwd_globals) { CWD_STATE_COPY(&cwd_globals->cwd, &main_cwd_state); } -static void cwd_globals_dtor(zend_cwd_globals *cwd_globals) +static void cwd_globals_dtor(virtual_cwd_globals *cwd_globals) { CWD_STATE_FREE(&cwd_globals->cwd); } @@ -167,7 +171,12 @@ CWD_API void virtual_cwd_startup(void) main_cwd_state.cwd = strdup(cwd); main_cwd_state.cwd_length = strlen(cwd); - ZEND_INIT_MODULE_GLOBALS(cwd, cwd_globals_ctor, cwd_globals_dtor); +#ifdef ZTS + cwd_globals_id = ts_allocate_id(sizeof(virtual_cwd_globals), (ts_allocate_ctor) cwd_globals_ctor, (ts_allocate_dtor) cwd_globals_dtor); +#else + cwd_globals_ctor(&cwd_globals); +#endif + #if defined(ZEND_WIN32) && defined(ZTS) cwd_mutex = tsrm_mutex_alloc(); #endif |
