]> git.kaiwu.me - nginx.git/commitdiff
ignore EACCES errors for top level directories in ngx_create_full_path()
authorIgor Sysoev <igor@sysoev.ru>
Wed, 14 Oct 2009 11:46:09 +0000 (11:46 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Wed, 14 Oct 2009 11:46:09 +0000 (11:46 +0000)
src/core/ngx_file.c

index b93a209677e157734de73a2fb34c4e17939bc841..54adf34855829ae8ab387a3a010b5913ccca6179 100644 (file)
@@ -183,6 +183,8 @@ ngx_create_full_path(u_char *dir, ngx_uint_t access)
     u_char     *p, ch;
     ngx_err_t   err;
 
+    err = 0;
+
 #if (NGX_WIN32)
     p = dir + 3;
 #else
@@ -200,7 +202,14 @@ ngx_create_full_path(u_char *dir, ngx_uint_t access)
 
         if (ngx_create_dir(dir, access) == NGX_FILE_ERROR) {
             err = ngx_errno;
-            if (err != NGX_EEXIST) {
+
+            switch (err) {
+            case NGX_EEXIST:
+                err = 0;
+            case NGX_EACCES:
+                break;
+
+            default:
                 return err;
             }
         }
@@ -208,7 +217,7 @@ ngx_create_full_path(u_char *dir, ngx_uint_t access)
         *p = '/';
     }
 
-    return 0;
+    return err;
 }