cvs: php-src(PHP_5_2) /ext/bz2 bz2.c
| From: | Antony Dovgal | Date: | Wed, 23 Jul 2008 08:56:38 +0000 |
| Subject: | cvs: php-src(PHP_5_2) /ext/bz2 bz2.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-51422@lists.php.net to get a copy of this message | ||
tony2001 Wed Jul 23 08:56:38 2008 UTC
Modified files: (Branch: PHP_5_2)
/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.13&r2=1.14.2.3.2.14&diff_format=u
Index: php-src/ext/bz2/bz2.c
diff -u php-src/ext/bz2/bz2.c:1.14.2.3.2.13 php-src/ext/bz2/bz2.c:1.14.2.3.2.14
--- php-src/ext/bz2/bz2.c:1.14.2.3.2.13 Mon Dec 31 07:20:04 2007
+++ php-src/ext/bz2/bz2.c Wed Jul 23 08:56:37 2008
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: bz2.c,v 1.14.2.3.2.13 2007/12/31 07:20:04 sebastian Exp $ */
+/* $Id: bz2.c,v 1.14.2.3.2.14 2008/07/23 08:56:37 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;
}