diff src/os/unix/ngx_files.c @ 1980:b5263e401884

ignore glob no match error
author Igor Sysoev <igor@sysoev.ru>
date Tue, 29 Apr 2008 09:28:42 +0000
parents bb139aba3199
children 25add486e7aa
line wrap: on
line diff
--- a/src/os/unix/ngx_files.c
+++ b/src/os/unix/ngx_files.c
@@ -257,7 +257,15 @@ ngx_open_dir(ngx_str_t *name, ngx_dir_t 
 ngx_int_t
 ngx_open_glob(ngx_glob_t *gl)
 {
-    if (glob((char *) gl->pattern, GLOB_NOSORT, NULL, &gl->pglob) == 0) {
+    int  n;
+
+    n = glob((char *) gl->pattern, GLOB_NOSORT, NULL, &gl->pglob);
+
+    if (n == 0) {
+        return NGX_OK;
+    }
+
+    if (n == GLOB_NOMATCH && gl->test) {
         return NGX_OK;
     }