diff options
author | Anatol Belski <ab@php.net> | 2017-05-27 23:07:49 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2017-05-27 23:07:49 +0200 |
commit | 7312244034f35354502691f5b7c5b4e32d05a105 (patch) | |
tree | 345fea8d46cc5b3debb09feb5838c316d7638ba8 | |
parent | cebfe63e3b24ea92a1891a840be1481b84579285 (diff) | |
download | php-git-7312244034f35354502691f5b7c5b4e32d05a105.tar.gz |
Improve conditions and visibility
-rw-r--r-- | ext/dba/dba.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/dba/dba.c b/ext/dba/dba.c index 754ae10a8a..8f7747c5de 100644 --- a/ext/dba/dba.c +++ b/ext/dba/dba.c @@ -646,6 +646,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) char *lock_name; #ifdef PHP_WIN32 zend_bool restarted = 0; + zend_bool need_creation = 0; #endif if (ac < 2) { @@ -767,10 +768,8 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) break; case 'c': { #ifdef PHP_WIN32 - php_stream_statbuf ssb; - zend_bool need_creation = 0; - if (hptr->flags & (DBA_NO_APPEND|DBA_CAST_AS_FD)) { + php_stream_statbuf ssb; need_creation = (SUCCESS != php_stream_stat_path(Z_STRVAL(args[0]), &ssb)); } #endif @@ -957,7 +956,7 @@ restart: int flags = fcntl(info->fd, F_GETFL); fcntl(info->fd, F_SETFL, flags & ~O_APPEND); #elif defined(PHP_WIN32) - } else if (modenr == DBA_CREAT && !restarted) { + } else if (modenr == DBA_CREAT && need_creation && !restarted) { zend_bool close_both; close_both = (info->fp != info->lock.fp); |