From 87626d56d2ca145a92c5d5505ad0d922bb42a11d Mon Sep 17 00:00:00 2001 From: Steph Fox Date: Mon, 18 Feb 2008 04:42:04 +0000 Subject: [PATCH] Fix ZTS build *nicely* --- ext/phar/phar.c | 6 +++--- ext/phar/phar_internal.h | 2 +- ext/phar/phar_object.c | 6 +++--- ext/phar/tar.c | 2 +- ext/phar/util.c | 12 +++++------- ext/phar/zip.c | 4 ++-- 6 files changed, 15 insertions(+), 17 deletions(-) diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 46177a0a80..575bfb278c 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -1957,7 +1957,7 @@ int phar_flush(phar_archive_data *phar, char *user_stub, long len, char **error if (oldfile && !entry->is_modified) { continue; } - if (!phar_get_efp(entry)) { + if (!phar_get_efp(entry TSRMLS_CC)) { /* re-open internal file pointer just-in-time */ newentry = phar_open_jit(phar, entry, oldfile, error, 0 TSRMLS_CC); if (!newentry) { @@ -1968,7 +1968,7 @@ int phar_flush(phar_archive_data *phar, char *user_stub, long len, char **error } entry = newentry; } - file = phar_get_efp(entry); + file = phar_get_efp(entry TSRMLS_CC); if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0 TSRMLS_CC)) { if (closeoldfile) { php_stream_close(oldfile); @@ -2218,7 +2218,7 @@ int phar_flush(phar_archive_data *phar, char *user_stub, long len, char **error file = entry->cfp; php_stream_rewind(file); } else { - file = phar_get_efp(entry); + file = phar_get_efp(entry TSRMLS_CC); if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0 TSRMLS_CC)) { if (closeoldfile) { php_stream_close(oldfile); diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h index 5679b140f2..f8be40ca70 100755 --- a/ext/phar/phar_internal.h +++ b/ext/phar/phar_internal.h @@ -380,7 +380,7 @@ phar_entry_info * phar_open_jit(phar_archive_data *phar, phar_entry_info *entry, int phar_parse_metadata(char **buffer, zval **metadata, int is_zip TSRMLS_DC); void destroy_phar_manifest_entry(void *pDest); int phar_seek_efp(phar_entry_info *entry, off_t offset, int whence, off_t position TSRMLS_DC); -php_stream *phar_get_efp(phar_entry_info *entry); +php_stream *phar_get_efp(phar_entry_info *entry TSRMLS_DC); int phar_copy_entry_fp(phar_entry_info *source, phar_entry_info *dest, char **error TSRMLS_DC); int phar_open_entry_fp(phar_entry_info *entry, char **error TSRMLS_DC); int phar_create_writeable_entry(phar_archive_data *phar, phar_entry_info *entry, char **error TSRMLS_DC); diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index efb2f2f57f..d6c1dd6238 100755 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -230,7 +230,7 @@ static int phar_file_action(phar_entry_data *phar, char *mime_type, int code, ch } /* prepare to output */ - if (!phar_get_efp(phar->internal_file)) { + if (!phar_get_efp(phar->internal_file TSRMLS_CC)) { char *error; if (!phar_open_jit(phar->phar, phar->internal_file, phar->phar->fp, &error, 0 TSRMLS_CC)) { if (error) { @@ -239,7 +239,7 @@ static int phar_file_action(phar_entry_data *phar, char *mime_type, int code, ch } return -1; } - phar->fp = phar_get_efp(phar->internal_file); + phar->fp = phar_get_efp(phar->internal_file TSRMLS_CC); phar->zero = phar->internal_file->offset; } phar_seek_efp(phar->internal_file, 0, SEEK_SET, 0 TSRMLS_CC); @@ -1523,7 +1523,7 @@ static int phar_copy_file_contents(phar_entry_info *entry, php_stream *fp TSRMLS /* copy old contents in entirety */ phar_seek_efp(entry, 0, SEEK_SET, 0 TSRMLS_CC); offset = php_stream_tell(fp); - if (entry->uncompressed_filesize != php_stream_copy_to_stream(phar_get_efp(entry), fp, entry->uncompressed_filesize)) { + if (entry->uncompressed_filesize != php_stream_copy_to_stream(phar_get_efp(entry TSRMLS_CC), fp, entry->uncompressed_filesize)) { zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Cannot convert phar archive \"%s\", unable to copy entry \"%s\" contents", entry->phar->fname, entry->filename); return FAILURE; diff --git a/ext/phar/tar.c b/ext/phar/tar.c index 480982feaf..6554796052 100644 --- a/ext/phar/tar.c +++ b/ext/phar/tar.c @@ -406,7 +406,7 @@ int phar_tar_writeheaders(void *pDest, void *argument TSRMLS_DC) } return ZEND_HASH_APPLY_STOP; } - if (entry->uncompressed_filesize != php_stream_copy_to_stream(phar_get_efp(entry), fp->new, entry->uncompressed_filesize)) { + if (entry->uncompressed_filesize != php_stream_copy_to_stream(phar_get_efp(entry TSRMLS_CC), fp->new, entry->uncompressed_filesize)) { if (fp->error) { spprintf(fp->error, 4096, "tar-based phar \"%s\" cannot be created, contents of file \"%s\" could not be written", entry->phar->fname, entry->filename); } diff --git a/ext/phar/util.c b/ext/phar/util.c index f537601025..519dfdfc50 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -23,10 +23,8 @@ #include "phar_internal.h" /* retrieve a phar_entry_info's current file pointer for reading contents */ -php_stream *phar_get_efp(phar_entry_info *entry) +php_stream *phar_get_efp(phar_entry_info *entry TSRMLS_DC) { - TSRMLS_FETCH(); - if (entry->fp_type == PHAR_FP) { if (!entry->phar->fp) { /* re-open just in time for cases where our refcount reached 0 on the phar archive */ @@ -48,7 +46,7 @@ php_stream *phar_get_efp(phar_entry_info *entry) int phar_seek_efp(phar_entry_info *entry, off_t offset, int whence, off_t position TSRMLS_DC) { - php_stream *fp = phar_get_efp(entry); + php_stream *fp = phar_get_efp(entry TSRMLS_CC); off_t temp; if (entry->is_dir) { @@ -285,7 +283,7 @@ int phar_get_entry_data(phar_entry_data **ret, char *fname, int fname_len, char (*ret)->internal_file = entry; (*ret)->is_zip = entry->is_zip; (*ret)->is_tar = entry->is_tar; - (*ret)->fp = phar_get_efp(entry); + (*ret)->fp = phar_get_efp(entry TSRMLS_CC); (*ret)->zero = entry->offset; entry->fp_refcount++; entry->phar->refcount++; @@ -416,7 +414,7 @@ int phar_copy_entry_fp(phar_entry_info *source, phar_entry_info *dest, char **er dest->fp = php_stream_fopen_tmpfile(); phar_seek_efp(source, 0, SEEK_SET, 0 TSRMLS_CC); - if (source->uncompressed_filesize != php_stream_copy_to_stream(phar_get_efp(source), dest->fp, source->uncompressed_filesize)) { + if (source->uncompressed_filesize != php_stream_copy_to_stream(phar_get_efp(source TSRMLS_CC), dest->fp, source->uncompressed_filesize)) { php_stream_close(dest->fp); dest->fp_type = PHAR_FP; if (error) { @@ -595,7 +593,7 @@ int phar_separate_entry_fp(phar_entry_info *entry, char **error TSRMLS_DC) fp = php_stream_fopen_tmpfile(); phar_seek_efp(entry, 0, SEEK_SET, 0 TSRMLS_CC); - if (entry->uncompressed_filesize != php_stream_copy_to_stream(phar_get_efp(entry), fp, entry->uncompressed_filesize)) { + if (entry->uncompressed_filesize != php_stream_copy_to_stream(phar_get_efp(entry TSRMLS_CC), fp, entry->uncompressed_filesize)) { if (error) { spprintf(error, 4096, "phar error: cannot separate entry file \"%s\" contents in phar archive \"%s\" for write access", entry->filename, entry->phar->fname); } diff --git a/ext/phar/zip.c b/ext/phar/zip.c index 2626a34cd9..6d5a8b522f 100644 --- a/ext/phar/zip.c +++ b/ext/phar/zip.c @@ -474,7 +474,7 @@ static int phar_zip_changed_apply(void *data, void *arg TSRMLS_DC) /* {{{ */ spprintf(p->error, 0, "unable to seek to start of file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fname); return ZEND_HASH_APPLY_STOP; } - efp = phar_get_efp(entry); + efp = phar_get_efp(entry TSRMLS_CC); newcrc32 = ~0; for (loc = 0;loc < entry->uncompressed_filesize; loc++) { @@ -607,7 +607,7 @@ continue_dir: return ZEND_HASH_APPLY_STOP; } phar_seek_efp(entry, 0, SEEK_SET, 0 TSRMLS_CC); - if (entry->uncompressed_filesize != php_stream_copy_to_stream(phar_get_efp(entry), p->filefp, entry->uncompressed_filesize)) { + if (entry->uncompressed_filesize != php_stream_copy_to_stream(phar_get_efp(entry TSRMLS_CC), p->filefp, entry->uncompressed_filesize)) { spprintf(p->error, 0, "unable to write contents of file \"%s\" in zip-based phar \"%s\"", entry->filename, entry->phar->fname); return ZEND_HASH_APPLY_STOP; } -- 2.50.1