diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2003-07-29 18:26:34 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2003-07-29 18:26:34 +0000 |
commit | 4d98e9ec970ed72848c82f7ed0fe7060ad37f66d (patch) | |
tree | 68f321d17dd025f0b430f45bb69810c86823723e /ext/dba/dba.c | |
parent | 7b18132dbab996cd4a7962907e45a2925ca3544d (diff) | |
download | php-git-4d98e9ec970ed72848c82f7ed0fe7060ad37f66d.tar.gz |
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.
Diffstat (limited to 'ext/dba/dba.c')
-rw-r--r-- | ext/dba/dba.c | 12 |
1 files changed, 10 insertions, 2 deletions
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); |