From: Anatol Belski Date: Sat, 27 May 2017 21:07:49 +0000 (+0200) Subject: Improve conditions and visibility X-Git-Tag: php-7.2.0alpha1~57^2~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7312244034f35354502691f5b7c5b4e32d05a105;p=php Improve conditions and visibility --- 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);