Skip to content

Commit

Permalink
first shot remove TSRMLS_* things
Browse files Browse the repository at this point in the history
  • Loading branch information
weltling committed Dec 13, 2014
1 parent bb66f38 commit bdeb220
Show file tree
Hide file tree
Showing 786 changed files with 27,095 additions and 27,457 deletions.
33 changes: 15 additions & 18 deletions TSRM/tsrm_win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static ts_rsrc_id win32_globals_id;
static tsrm_win32_globals win32_globals;
#endif

static void tsrm_win32_ctor(tsrm_win32_globals *globals TSRMLS_DC)
static void tsrm_win32_ctor(tsrm_win32_globals *globals)
{
#ifdef ZTS
TSRMLS_CACHE_UPDATE;
Expand All @@ -62,7 +62,7 @@ TSRMLS_CACHE_UPDATE;
globals->impersonation_token_sid = NULL;
}

static void tsrm_win32_dtor(tsrm_win32_globals *globals TSRMLS_DC)
static void tsrm_win32_dtor(tsrm_win32_globals *globals)
{
shm_pair *ptr;

Expand Down Expand Up @@ -95,18 +95,18 @@ TSRM_API void tsrm_win32_startup(void)
#ifdef ZTS
ts_allocate_id(&win32_globals_id, sizeof(tsrm_win32_globals), (ts_allocate_ctor)tsrm_win32_ctor, (ts_allocate_ctor)tsrm_win32_dtor);
#else
tsrm_win32_ctor(&win32_globals TSRMLS_CC);
tsrm_win32_ctor(&win32_globals);
#endif
}

TSRM_API void tsrm_win32_shutdown(void)
{
#ifndef ZTS
tsrm_win32_dtor(&win32_globals TSRMLS_CC);
tsrm_win32_dtor(&win32_globals);
#endif
}

char * tsrm_win32_get_path_sid_key(const char *pathname TSRMLS_DC)
char * tsrm_win32_get_path_sid_key(const char *pathname)
{
PSID pSid = TWG(impersonation_token_sid);
TCHAR *ptcSid = NULL;
Expand Down Expand Up @@ -194,7 +194,7 @@ PSID tsrm_win32_get_token_sid(HANDLE hToken)
return NULL;
}

TSRM_API int tsrm_win32_access(const char *pathname, int mode TSRMLS_DC)
TSRM_API int tsrm_win32_access(const char *pathname, int mode)
{
time_t t;
HANDLE thread_token = NULL;
Expand All @@ -217,7 +217,7 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode TSRMLS_DC)
} else {
if(!IS_ABSOLUTE_PATH(pathname, strlen(pathname)+1)) {
real_path = (char *)malloc(MAX_PATH);
if(tsrm_realpath(pathname, real_path TSRMLS_CC) == NULL) {
if(tsrm_realpath(pathname, real_path) == NULL) {
goto Finished;
}
pathname = real_path;
Expand Down Expand Up @@ -281,14 +281,14 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode TSRMLS_DC)

if (CWDG(realpath_cache_size_limit)) {
t = time(0);
bucket = realpath_cache_lookup(pathname, (int)strlen(pathname), t TSRMLS_CC);
bucket = realpath_cache_lookup(pathname, (int)strlen(pathname), t);
if(bucket == NULL && real_path == NULL) {
/* We used the pathname directly. Call tsrm_realpath */
/* so that entry is created in realpath cache */
real_path = (char *)malloc(MAX_PATH);
if(tsrm_realpath(pathname, real_path TSRMLS_CC) != NULL) {
if(tsrm_realpath(pathname, real_path) != NULL) {
pathname = real_path;
bucket = realpath_cache_lookup(pathname, (int)strlen(pathname), t TSRMLS_CC);
bucket = realpath_cache_lookup(pathname, (int)strlen(pathname), t);
}
}
}
Expand Down Expand Up @@ -383,7 +383,7 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode TSRMLS_DC)
}


static process_pair *process_get(FILE *stream TSRMLS_DC)
static process_pair *process_get(FILE *stream)
{
process_pair *ptr;
process_pair *newptr;
Expand Down Expand Up @@ -413,7 +413,6 @@ static shm_pair *shm_get(int key, void *addr)
{
shm_pair *ptr;
shm_pair *newptr;
TSRMLS_FETCH();

for (ptr = TWG(shm); ptr < (TWG(shm) + TWG(shm_size)); ptr++) {
if (!ptr->descriptor) {
Expand Down Expand Up @@ -451,12 +450,11 @@ static HANDLE dupHandle(HANDLE fh, BOOL inherit) {

TSRM_API FILE *popen(const char *command, const char *type)
{
TSRMLS_FETCH();

return popen_ex(command, type, NULL, NULL TSRMLS_CC);
return popen_ex(command, type, NULL, NULL);
}

TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env TSRMLS_DC)
TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env)
{
FILE *stream = NULL;
int fno, type_len, read, mode;
Expand Down Expand Up @@ -553,7 +551,7 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
}

CloseHandle(process.hThread);
proc = process_get(NULL TSRMLS_CC);
proc = process_get(NULL);

if (read) {
fno = _open_osfhandle((tsrm_intptr_t)in, _O_RDONLY | mode);
Expand All @@ -573,9 +571,8 @@ TSRM_API int pclose(FILE *stream)
{
DWORD termstat = 0;
process_pair *process;
TSRMLS_FETCH();

if ((process = process_get(stream TSRMLS_CC)) == NULL) {
if ((process = process_get(stream)) == NULL) {
return 0;
}

Expand Down
6 changes: 3 additions & 3 deletions TSRM/tsrm_win32.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ TSRMLS_CACHE_EXTERN;
#define SHM_RND FILE_MAP_WRITE
#define SHM_REMAP FILE_MAP_COPY

char * tsrm_win32_get_path_sid_key(const char *pathname TSRMLS_DC);
char * tsrm_win32_get_path_sid_key(const char *pathname );

TSRM_API void tsrm_win32_startup(void);
TSRM_API void tsrm_win32_shutdown(void);

TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env TSRMLS_DC);
TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env);
TSRM_API FILE *popen(const char *command, const char *type);
TSRM_API int pclose(FILE *stream);
TSRM_API int tsrm_win32_access(const char *pathname, int mode TSRMLS_DC);
TSRM_API int tsrm_win32_access(const char *pathname, int mode);
TSRM_API int win32_utime(const char *filename, struct utimbuf *buf);

TSRM_API int shmget(int key, int size, int flags);
Expand Down
Loading

0 comments on commit bdeb220

Please sign in to comment.