File tree 1 file changed +3
-4
lines changed
1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -646,6 +646,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
646
646
char * lock_name ;
647
647
#ifdef PHP_WIN32
648
648
zend_bool restarted = 0 ;
649
+ zend_bool need_creation = 0 ;
649
650
#endif
650
651
651
652
if (ac < 2 ) {
@@ -767,10 +768,8 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
767
768
break ;
768
769
case 'c' : {
769
770
#ifdef PHP_WIN32
770
- php_stream_statbuf ssb ;
771
- zend_bool need_creation = 0 ;
772
-
773
771
if (hptr -> flags & (DBA_NO_APPEND |DBA_CAST_AS_FD )) {
772
+ php_stream_statbuf ssb ;
774
773
need_creation = (SUCCESS != php_stream_stat_path (Z_STRVAL (args [0 ]), & ssb ));
775
774
}
776
775
#endif
@@ -957,7 +956,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
957
956
int flags = fcntl (info -> fd , F_GETFL );
958
957
fcntl (info -> fd , F_SETFL , flags & ~O_APPEND );
959
958
#elif defined(PHP_WIN32)
960
- } else if (modenr == DBA_CREAT && !restarted ) {
959
+ } else if (modenr == DBA_CREAT && need_creation && !restarted ) {
961
960
zend_bool close_both ;
962
961
963
962
close_both = (info -> fp != info -> lock .fp );
You can’t perform that action at this time.
0 commit comments