tony2001                Wed Jul 23 08:56:29 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/bz2    bz2.c 
  Log:
  MFH: add PHP_STREAM_FLAG_FCLOSE, bz2 streams can be closed with fclose()
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/bz2/bz2.c?r1=1.14.2.3.2.12.2.4&r2=1.14.2.3.2.12.2.5&diff_format=u
Index: php-src/ext/bz2/bz2.c
diff -u php-src/ext/bz2/bz2.c:1.14.2.3.2.12.2.4 
php-src/ext/bz2/bz2.c:1.14.2.3.2.12.2.5
--- php-src/ext/bz2/bz2.c:1.14.2.3.2.12.2.4     Tue Jul  1 07:36:59 2008
+++ php-src/ext/bz2/bz2.c       Wed Jul 23 08:56:29 2008
@@ -16,7 +16,7 @@
   +----------------------------------------------------------------------+
 */
  
-/* $Id: bz2.c,v 1.14.2.3.2.12.2.4 2008/07/01 07:36:59 tony2001 Exp $ */
+/* $Id: bz2.c,v 1.14.2.3.2.12.2.5 2008/07/23 08:56:29 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -247,7 +247,9 @@
                        if (SUCCESS == php_stream_cast(stream, 
PHP_STREAM_AS_FD, (void **) &fd, REPORT_ERRORS)) {
                                bz_file = BZ2_bzdopen(fd, mode);
                        }
+                       stream->flags |= PHP_STREAM_FLAG_FCLOSE;
                }
+
                /* remove the file created by php_stream_open_wrapper(), it is 
not needed since BZ2 functions
                 * failed.
                 */
@@ -259,6 +261,7 @@
        if (bz_file) {
                retstream = _php_stream_bz2open_from_BZFILE(bz_file, mode, 
stream STREAMS_REL_CC TSRMLS_CC);
                if (retstream) {
+                       retstream->flags |= PHP_STREAM_FLAG_FCLOSE;
                        return retstream;
                }
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to