]> granicus.if.org Git - php/commitdiff
Fix ZTS build *nicely*
authorSteph Fox <sfox@php.net>
Mon, 18 Feb 2008 04:42:04 +0000 (04:42 +0000)
committerSteph Fox <sfox@php.net>
Mon, 18 Feb 2008 04:42:04 +0000 (04:42 +0000)
ext/phar/phar.c
ext/phar/phar_internal.h
ext/phar/phar_object.c
ext/phar/tar.c
ext/phar/util.c
ext/phar/zip.c

index 46177a0a8096d26dd05f1bb06c11fb1c921712ad..575bfb278c93275234c288897491987e380745e9 100644 (file)
@@ -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);
index 5679b140f256c9db0b791b8b64b4e260ca8b017a..f8be40ca70cca1ec87adec545046b2f78b6daf9a 100755 (executable)
@@ -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);
index efb2f2f57f653db2e70543cda6619ae863c854e7..d6c1dd62385c20f3293c2d90fac750055b9a2246 100755 (executable)
@@ -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;
index 480982feaf65bc62a9f314199d52f33f65caec7f..6554796052c38edbd9f9013fafa42b4f59d8d665 100644 (file)
@@ -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);
                }
index f537601025e7ef82751624f386b2546e873bb42e..519dfdfc500469aa62c3fc7629152181ce2b95be 100644 (file)
 #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);
                }
index 2626a34cd9d05d0ebd62f20c2c522246ff687450..6d5a8b522fcf06a3a2835cb5b7edb2bbce8991b5 100644 (file)
@@ -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;
                        }