CVS update: php31/main

From: Date: Tue, 22 Sep 1998 19:19:48 +0000
Subject: CVS update: php31/main
Groups: php.dev 
Request: Send a blank email to php-dev+get-1416@lists.php.net to get a copy of this message
Date: Tuesday September 22, 1998 @ 15:19 Author: shane Update of /repository/php31/main In directory asf:/u2/tmp/cvs-serv25775/main Modified Files: alloc.c control_structures_inline.h main.c safe_mode.c Log Message: Fix memory manager start/shutdown remove NT specific code so we can run on 95/98 again fix some compile warnings Index: php31/main/alloc.c diff -c php31/main/alloc.c:2.5 php31/main/alloc.c:2.6 *** php31/main/alloc.c:2.5 Tue Sep 22 10:25:34 1998 --- php31/main/alloc.c Tue Sep 22 15:19:46 1998 *************** *** 366,373 **** { unsigned int i, j; mem_header *p; ! memory_manager_rshutdown(); BLOCK_INTERRUPTIONS; for (i=0; i<MAX_CACHED_MEMORY; i++) { --- 366,376 ---- { unsigned int i, j; mem_header *p; + /*FIXME BLOCK_INTERUPTIONS uses sapi-rqst. we cannot shutdown + then use them! */ + TLS_VARS; ! /*memory_manager_rshutdown();*/ BLOCK_INTERRUPTIONS; for (i=0; i<MAX_CACHED_MEMORY; i++) { *************** *** 383,388 **** --- 386,393 ---- } } UNBLOCK_INTERRUPTIONS; + /* FIXME don't know if this will work now */ + memory_manager_rshutdown(); GLOBAL(initialized) &= ~INIT_MEMORY_MANAGER; } Index: php31/main/control_structures_inline.h diff -c php31/main/control_structures_inline.h:2.11 php31/main/control_structures_inline.h:2.12 *** php31/main/control_structures_inline.h:2.11 Sat Sep 19 12:50:31 1998 --- php31/main/control_structures_inline.h Tue Sep 22 15:19:46 1998 *************** *** 29,35 **** */ ! /* $Id: control_structures_inline.h,v 2.11 1998/09/19 16:50:31 rasmus Exp $ */ #ifdef THREAD_SAFE #include "tls.h" --- 29,35 ---- */ ! /* $Id: control_structures_inline.h,v 2.12 1998/09/22 19:19:46 shane Exp $ */ #ifdef THREAD_SAFE #include "tls.h" *************** *** 475,481 **** { if (GLOBAL(Execute)) { if (GLOBAL(function_state).func_arg_types) { ! unsigned char argument_offset=_php3_hash_next_free_element(GLOBAL(function_state).function_symbol_table)+1; if (argument_offset<=GLOBAL(function_state).func_arg_types[0] && GLOBAL(function_state).func_arg_types[argument_offset]==BYREF_FORCE) { --- 475,481 ---- { if (GLOBAL(Execute)) { if (GLOBAL(function_state).func_arg_types) { ! unsigned char argument_offset=(unsigned char)_php3_hash_next_free_element(GLOBAL(function_state).function_symbol_table)+1; if (argument_offset<=GLOBAL(function_state).func_arg_types[0] && GLOBAL(function_state).func_arg_types[argument_offset]==BYREF_FORCE) { *************** *** 1340,1346 **** /* ... check if we need to force by reference (set by_reference=1) */ if (GLOBAL(function_state).func_arg_types) { ! unsigned char argument_offset=_php3_hash_next_free_element(GLOBAL(function_state).function_symbol_table)+1; if (argument_offset<=GLOBAL(function_state).func_arg_types[0] && GLOBAL(function_state).func_arg_types[argument_offset]!=BYREF_NONE) { --- 1340,1346 ---- /* ... check if we need to force by reference (set by_reference=1) */ if (GLOBAL(function_state).func_arg_types) { ! unsigned char argument_offset=(unsigned char)_php3_hash_next_free_element(GLOBAL(function_state).function_symbol_table)+1; if (argument_offset<=GLOBAL(function_state).func_arg_types[0] && GLOBAL(function_state).func_arg_types[argument_offset]!=BYREF_NONE) { Index: php31/main/main.c diff -c php31/main/main.c:2.39 php31/main/main.c:2.40 *** php31/main/main.c:2.39 Tue Sep 22 10:25:35 1998 --- php31/main/main.c Tue Sep 22 15:19:47 1998 *************** *** 29,35 **** +----------------------------------------------------------------------+ */ ! /* $Id: main.c,v 2.39 1998/09/22 14:25:35 zeev Exp $ */ /* #define CRASH_DETECTION */ --- 29,35 ---- +----------------------------------------------------------------------+ */ ! /* $Id: main.c,v 2.40 1998/09/22 19:19:47 shane Exp $ */ /* #define CRASH_DETECTION */ *************** *** 679,685 **** TLS_VARS; GLOBAL(error_reporting) = 0; ! memory_manager_mshutdown(); } --- 679,686 ---- TLS_VARS; GLOBAL(error_reporting) = 0; ! /* FIXME this should only be called in sapi_thread_end or sapi_process_end ! memory_manager_mshutdown();*/ } *************** *** 1278,1284 **** /* make a temporary php3_ini for startup */ GLOBAL(php3_ini) = _php3_copy_ini_master(); if (php3_config_ini_startup(_INLINE_TLS_VOID) == FAILURE) { ! memory_manager_rshutdown(); free(GLOBAL(php3_ini)); return 0; } --- 1279,1285 ---- /* make a temporary php3_ini for startup */ GLOBAL(php3_ini) = _php3_copy_ini_master(); if (php3_config_ini_startup(_INLINE_TLS_VOID) == FAILURE) { ! memory_manager_mshutdown(); free(GLOBAL(php3_ini)); return 0; } *************** *** 1286,1292 **** debug_log("%d:INI Load Success\n", GetCurrentThreadId()); #endif if (php3_module_startup(_INLINE_TLS_VOID) == FAILURE) { ! memory_manager_rshutdown(); return 0; } /* load dl's from ini file */ --- 1287,1293 ---- debug_log("%d:INI Load Success\n", GetCurrentThreadId()); #endif if (php3_module_startup(_INLINE_TLS_VOID) == FAILURE) { ! memory_manager_mshutdown(); return 0; } /* load dl's from ini file */ *************** *** 1301,1307 **** #if defined(CRASH_DETECTION) debug_log("%d:DLL Load Success\n########################\n", GetCurrentThreadId()); #endif ! memory_manager_rshutdown(); free(GLOBAL(php3_ini)); return 1; } --- 1302,1308 ---- #if defined(CRASH_DETECTION) debug_log("%d:DLL Load Success\n########################\n", GetCurrentThreadId()); #endif ! free(GLOBAL(php3_ini)); return 1; } *************** *** 1351,1357 **** /* make a temporary php3_ini for startup */ GLOBAL(php3_ini) = _php3_copy_ini_master(); if (php3_module_startup(_INLINE_TLS_VOID) == FAILURE) { ! memory_manager_rshutdown(); return 0; } /*load dl's from ini file */ --- 1352,1358 ---- /* make a temporary php3_ini for startup */ GLOBAL(php3_ini) = _php3_copy_ini_master(); if (php3_module_startup(_INLINE_TLS_VOID) == FAILURE) { ! memory_manager_mshutdown(); return 0; } /*load dl's from ini file */ *************** *** 1363,1369 **** module_info->type = MODULE_PERSISTENT; _php3_load_module(module_info, NULL); } ! memory_manager_rshutdown(); free(GLOBAL(php3_ini)); #if defined(CRASH_DETECTION) debug_log("%d:DLL Thread Start Success\n########################\n", GetCurrentThreadId()); --- 1364,1370 ---- module_info->type = MODULE_PERSISTENT; _php3_load_module(module_info, NULL); } ! free(GLOBAL(php3_ini)); #if defined(CRASH_DETECTION) debug_log("%d:DLL Thread Start Success\n########################\n", GetCurrentThreadId()); *************** *** 1395,1400 **** --- 1396,1402 ---- #if defined(CRASH_DETECTION) debug_log("%d:DLL Thread End Success\n", GetCurrentThreadId()); #endif + memory_manager_mshutdown(); return 1; } *************** *** 1427,1432 **** --- 1429,1435 ---- PHP3_MUTEX_FREE(gLock); PHP3_CRITICAL_FREE(Tls_crit); #endif + memory_manager_mshutdown(); return 1; } *************** *** 1638,1644 **** #if defined(CRASH_DETECTION) debug_log("%d:request shutdown done\n", GetCurrentThreadId()); #endif - // GLOBAL(sapi_rqst=NULL); return SUCCESS; } else { return FAILURE; --- 1641,1646 ---- Index: php31/main/safe_mode.c diff -c php31/main/safe_mode.c:2.2 php31/main/safe_mode.c:2.3 *** php31/main/safe_mode.c:2.2 Tue Sep 1 13:43:31 1998 --- php31/main/safe_mode.c Tue Sep 22 15:19:47 1998 *************** *** 26,32 **** | Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> | +----------------------------------------------------------------------+ */ ! /* $Id: safe_mode.c,v 2.2 1998/09/01 17:43:31 zeev Exp $ */ #ifdef THREAD_SAFE #include "tls.h" #endif --- 26,32 ---- | Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> | +----------------------------------------------------------------------+ */ ! /* $Id: safe_mode.c,v 2.3 1998/09/22 19:19:47 shane Exp $ */ #ifdef THREAD_SAFE #include "tls.h" #endif *************** *** 41,47 **** #include <sys/stat.h> #include "ext/standard/pageinfo.h" #include "safe_mode.h" ! #if (WIN32|WINNT) #include "os/nt/fileaccess.h" #endif --- 41,47 ---- #include <sys/stat.h> #include "ext/standard/pageinfo.h" #include "safe_mode.h" ! #if (WIN32|WINNT) && USE_NT_SPECIFIC #include "os/nt/fileaccess.h" #endif *************** *** 58,64 **** PHPAPI int _php3_checkuid(const char *fn, int mode) { struct stat sb; int ret; ! #if (WIN32|WINNT) PSID uid=NULL, duid=NULL; #else long uid=0L, duid=0L; --- 58,64 ---- PHPAPI int _php3_checkuid(const char *fn, int mode) { struct stat sb; int ret; ! #if (WIN32|WINNT) && USE_NT_SPECIFIC PSID uid=NULL, duid=NULL; #else long uid=0L, duid=0L; *************** *** 79,85 **** ret = stat(fn,&sb); if (ret<0 && mode < 2) return(mode); if (ret>-1) { ! #if (WIN32|WINNT) uid=GetFileOwner((LPTSTR)fn); if (EqualSid(uid,_php3_getuid())){ LocalFree(uid); --- 79,85 ---- ret = stat(fn,&sb); if (ret<0 && mode < 2) return(mode); if (ret>-1) { ! #if (WIN32|WINNT) && USE_NT_SPECIFIC uid=GetFileOwner((LPTSTR)fn); if (EqualSid(uid,_php3_getuid())){ LocalFree(uid); *************** *** 103,109 **** if (s) { *s='\0'; ! #if (WIN32|WINNT) duid=GetFileOwner((LPTSTR)fn); *s='/'; #else --- 103,109 ---- if (s) { *s='\0'; ! #if (WIN32|WINNT) && USE_NT_SPECIFIC duid=GetFileOwner((LPTSTR)fn); *s='/'; #else *************** *** 115,121 **** } else { s = emalloc(MAXPATHLEN+1); if (!getcwd(s,MAXPATHLEN)) return(0); ! #if (WIN32|WINNT) duid=GetFileOwner((LPTSTR)fn); efree(s); #else --- 115,121 ---- } else { s = emalloc(MAXPATHLEN+1); if (!getcwd(s,MAXPATHLEN)) return(0); ! #if (WIN32|WINNT) && USE_NT_SPECIFIC duid=GetFileOwner((LPTSTR)fn); efree(s); #else *************** *** 125,131 **** duid = sb.st_uid; #endif } ! #if (WIN32|WINNT) if (EqualSid(duid,_php3_getuid())){ LocalFree(duid); return(1); --- 125,131 ---- duid = sb.st_uid; #endif } ! #if (WIN32|WINNT) && USE_NT_SPECIFIC if (EqualSid(duid,_php3_getuid())){ LocalFree(duid); return(1); *************** *** 139,145 **** PHPAPI char *_php3_get_current_user() { ! #if (WIN32|WINNT) PSID uid=NULL; char *username=NULL; #else --- 139,145 ---- PHPAPI char *_php3_get_current_user() { ! #if (WIN32|WINNT) && USE_NT_SPECIFIC PSID uid=NULL; char *username=NULL; #else *************** *** 153,159 **** return GLOBAL(sapi_rqst)->current_user; } ! #if (WIN32|WINNT) if (!GLOBAL(sapi_rqst)->filename || !(uid=GetFileOwner((LPTSTR)GLOBAL(sapi_rqst)->filename))) { return empty_string; } --- 153,159 ---- return GLOBAL(sapi_rqst)->current_user; } ! #if (WIN32|WINNT) && USE_NT_SPECIFIC if (!GLOBAL(sapi_rqst)->filename || !(uid=GetFileOwner((LPTSTR)GLOBAL(sapi_rqst)->filename))) { return empty_string; } *************** *** 164,176 **** free(username); LocalFree(uid); #else ! if(sapi_rqst->page_uid<0){ if (!GLOBAL(sapi_rqst)->filename || (stat(GLOBAL(sapi_rqst)->filename,&statbuf)==-1)) { return empty_string; } uid = statbuf.st_uid; } else { ! uid=sapi_rqst->page_uid; } if ((pwd=getpwuid(uid))==NULL) { return empty_string; --- 164,176 ---- free(username); LocalFree(uid); #else ! if(GLOBAL(sapi_rqst)->page_uid<0){ if (!GLOBAL(sapi_rqst)->filename || (stat(GLOBAL(sapi_rqst)->filename,&statbuf)==-1)) { return empty_string; } uid = statbuf.st_uid; } else { ! uid=GLOBAL(sapi_rqst)->page_uid; } if ((pwd=getpwuid(uid))==NULL) { return empty_string; -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#1416) next »