From 4d98e9ec970ed72848c82f7ed0fe7060ad37f66d Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Tue, 29 Jul 2003 18:26:34 +0000 Subject: Finalize the closing process of persistent streams. The current behavior/API is as follows: 1) To close a persistent use php_stream_pclose(), it will close the stream and remove it from the persistent list. 2) Inside PHP code only explicit fclose() will close persistent streams, all other actions such as unset() or assigning a value to stream handle will not. 3) Regular streams can still be closed by either fclose(), unset() or an assignment of a value to the stream handler. --- ext/dba/dba.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'ext/dba/dba.c') diff --git a/ext/dba/dba.c b/ext/dba/dba.c index d58a92dd85..ed74bbbb7e 100644 --- a/ext/dba/dba.c +++ b/ext/dba/dba.c @@ -321,10 +321,18 @@ static void dba_close(dba_info *info TSRMLS_DC) pefree(info->path, info->flags&DBA_PERSISTENT); } if (info->fp && info->fp!=info->lock.fp) { - php_stream_close(info->fp); + if(info->flags&DBA_PERSISTENT) { + php_stream_pclose(info->fp); + } else { + php_stream_close(info->fp); + } } if (info->lock.fp) { - php_stream_close(info->lock.fp); + if(info->flags&DBA_PERSISTENT) { + php_stream_pclose(info->lock.fp); + } else { + php_stream_close(info->lock.fp); + } } if (info->lock.name) { pefree(info->lock.name, info->flags&DBA_PERSISTENT); -- cgit v1.2.1