helly           Mon Nov 11 07:04:12 2002 EDT

  Modified files:              
    /php4/ext/dba       dba.c 
  Log:
  -fix file open mode when modifier 'd' is used
  #Add my name to authors
  
  
Index: php4/ext/dba/dba.c
diff -u php4/ext/dba/dba.c:1.59 php4/ext/dba/dba.c:1.60
--- php4/ext/dba/dba.c:1.59     Sun Nov 10 18:07:35 2002
+++ php4/ext/dba/dba.c  Mon Nov 11 07:04:12 2002
@@ -12,11 +12,12 @@
    | obtain it through the world-wide-web, please send a note to          |
    | [EMAIL PROTECTED] so we can mail you a copy immediately.               |
    +----------------------------------------------------------------------+
-   | Author: Sascha Schumann <[EMAIL PROTECTED]>                         |
+   | Authors: Sascha Schumann <[EMAIL PROTECTED]>                        |
+   |          Marcus Boerger <[EMAIL PROTECTED]>                              |
    +----------------------------------------------------------------------+
  */
 
-/* $Id: dba.c,v 1.59 2002/11/10 23:07:35 helly Exp $ */
+/* $Id: dba.c,v 1.60 2002/11/11 12:04:12 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -315,7 +316,7 @@
        int i;
        int lock_mode, lock_flag, lock_dbf = 0;
        char *file_mode;
-       char mode[4], *pmode;
+       char mode[4], *pmode, *lock_file_mode;
        
        if(ac < 3) {
                WRONG_PARAM_COUNT;
@@ -452,11 +453,14 @@
        info->argv = args + 3;
 
        if (lock_mode) {
-               if (lock_dbf)
+               if (lock_dbf) {
                        info->lock.name = estrdup(info->path);
-               else
+                       lock_file_mode = file_mode;
+               } else {
                        spprintf(&info->lock.name, 0, "%s.lck", info->path);
-               info->lock.fp = php_stream_open_wrapper(info->lock.name, "a+b", 
STREAM_MUST_SEEK|REPORT_ERRORS|IGNORE_PATH|ENFORCE_SAFE_MODE, NULL);
+                       lock_file_mode = "a+b";
+               }
+               info->lock.fp = php_stream_open_wrapper(info->lock.name, 
+lock_file_mode, STREAM_MUST_SEEK|REPORT_ERRORS|IGNORE_PATH|ENFORCE_SAFE_MODE, NULL);
                if (!info->lock.fp) {
                        dba_close(info TSRMLS_CC);
                        /* stream operation already wrote an error message */



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to