@@ -2520,16 +2520,16 @@ zend_string *phar_create_default_stub(const char *index_php, const char *web_ind
25202520}
25212521/* }}} */
25222522
2523- int phar_flush (phar_archive_data * phar , char * * error ) {
2524- return phar_flush_ex (phar , NULL , false, error );
2523+ void phar_flush (phar_archive_data * phar , char * * error ) {
2524+ phar_flush_ex (phar , NULL , false, error );
25252525}
25262526
25272527/**
25282528 * Save phar contents to disk
25292529 *
25302530 * if user_stub is NULL the default or existing stub should be used
25312531 */
2532- int phar_flush_ex (phar_archive_data * phar , zend_string * user_stub , bool is_default_stub , char * * error ) /* {{{ */
2532+ void phar_flush_ex (phar_archive_data * phar , zend_string * user_stub , bool is_default_stub , char * * error ) /* {{{ */
25332533{
25342534 static const char halt_stub [] = "__HALT_COMPILER();" ;
25352535
@@ -2557,29 +2557,31 @@ int phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defau
25572557 if (error ) {
25582558 spprintf (error , 0 , "internal error: attempt to flush cached zip-based phar \"%s\"" , phar -> fname );
25592559 }
2560- return EOF ;
2560+ return ;
25612561 }
25622562
25632563 if (error ) {
25642564 * error = NULL ;
25652565 }
25662566
25672567 if (!zend_hash_num_elements (& phar -> manifest ) && !user_stub ) {
2568- return EOF ;
2568+ return ;
25692569 }
25702570
25712571 zend_hash_clean (& phar -> virtual_dirs );
25722572
25732573 if (phar -> is_zip ) {
2574- return phar_zip_flush (phar , user_stub , is_default_stub , error );
2574+ phar_zip_flush (phar , user_stub , is_default_stub , error );
2575+ return ;
25752576 }
25762577
25772578 if (phar -> is_tar ) {
2578- return phar_tar_flush (phar , user_stub , is_default_stub , error );
2579+ phar_tar_flush (phar , user_stub , is_default_stub , error );
2580+ return ;
25792581 }
25802582
25812583 if (PHAR_G (readonly )) {
2582- return EOF ;
2584+ return ;
25832585 }
25842586
25852587 if (phar -> fp && !phar -> is_brandnew ) {
@@ -2598,7 +2600,7 @@ int phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defau
25982600 if (must_close_old_file ) {
25992601 php_stream_close (oldfile );
26002602 }
2601- return EOF ;
2603+ return ;
26022604 }
26032605
26042606 if (user_stub ) {
@@ -2612,7 +2614,7 @@ int phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defau
26122614 if (error ) {
26132615 spprintf (error , 0 , "illegal stub for phar \"%s\" (__HALT_COMPILER(); is missing)" , phar -> fname );
26142616 }
2615- return EOF ;
2617+ return ;
26162618 }
26172619
26182620 size_t len = pos - ZSTR_VAL (user_stub ) + strlen (halt_stub );
@@ -2630,7 +2632,7 @@ int phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defau
26302632 if (error ) {
26312633 spprintf (error , 0 , "unable to create stub from string in new phar \"%s\"" , phar -> fname );
26322634 }
2633- return EOF ;
2635+ return ;
26342636 }
26352637 phar -> halt_offset = len + end_sequence_len ;
26362638 } else {
@@ -2660,7 +2662,7 @@ int phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defau
26602662 if (new_stub ) {
26612663 zend_string_free (new_stub );
26622664 }
2663- return EOF ;
2665+ return ;
26642666 }
26652667 if (new_stub ) {
26662668 zend_string_free (new_stub );
@@ -2756,7 +2758,7 @@ int phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defau
27562758 if (error ) {
27572759 spprintf (error , 0 , "unable to seek to start of file \"%s\" while creating new phar \"%s\"" , entry -> filename , phar -> fname );
27582760 }
2759- return EOF ;
2761+ return ;
27602762 }
27612763 newcrc32 = php_crc32_bulk_init ();
27622764 php_crc32_stream_bulk_update (& newcrc32 , file , entry -> uncompressed_filesize );
@@ -2782,7 +2784,7 @@ int phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defau
27822784 spprintf (error , 0 , "unable to bzip2 compress file \"%s\" to new phar \"%s\"" , entry -> filename , phar -> fname );
27832785 }
27842786 }
2785- return EOF ;
2787+ return ;
27862788 }
27872789
27882790 /* create new file that holds the compressed versions */
@@ -3105,7 +3107,7 @@ int phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defau
31053107 php_stream_close (oldfile );
31063108 }
31073109 php_stream_close (newfile );
3108- return EOF ;
3110+ return ;
31093111 }
31103112
31113113 php_stream_write (newfile , digest , digest_len );
@@ -3157,7 +3159,7 @@ int phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defau
31573159 if (error ) {
31583160 spprintf (error , 4096 , "unable to open new phar \"%s\" for writing" , phar -> fname );
31593161 }
3160- return EOF ;
3162+ return ;
31613163 }
31623164
31633165 if (phar -> flags & PHAR_FILE_COMPRESSED_GZ ) {
@@ -3173,7 +3175,7 @@ int phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defau
31733175 if (error ) {
31743176 spprintf (error , 4096 , "unable to compress all contents of phar \"%s\" using zlib, PHP versions older than 5.2.6 have a buggy zlib" , phar -> fname );
31753177 }
3176- return EOF ;
3178+ return ;
31773179 }
31783180
31793181 php_stream_filter_append (& phar -> fp -> writefilters , filter );
@@ -3203,10 +3205,9 @@ int phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defau
32033205 if (error ) {
32043206 spprintf (error , 0 , "unable to seek to __HALT_COMPILER(); in new phar \"%s\"" , phar -> fname );
32053207 }
3206- return EOF ;
32073208 }
32083209
3209- return EOF ;
3210+ return ;
32103211
32113212cleanup :
32123213 if (shared_cfp != NULL ) {
@@ -3218,8 +3219,6 @@ int phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defau
32183219 entry -> header_offset = 0 ;
32193220 }
32203221 } ZEND_HASH_FOREACH_END ();
3221-
3222- return EOF ;
32233222}
32243223/* }}} */
32253224
0 commit comments