diff options
author | Igor Sysoev <igor@sysoev.ru> | 2008-04-29 09:28:42 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2008-04-29 09:28:42 +0000 |
commit | a13b3b97eafbbe7fa6586e4f73b8c80ee478244c (patch) | |
tree | 3bf8bd774d810a450edfcefe2c5ab7fc68010e40 /src/os/unix | |
parent | 8443360bac77bfbc123cc40943a8f851b5a5edd6 (diff) | |
download | nginx-a13b3b97eafbbe7fa6586e4f73b8c80ee478244c.tar.gz nginx-a13b3b97eafbbe7fa6586e4f73b8c80ee478244c.zip |
ignore glob no match error
Diffstat (limited to 'src/os/unix')
-rw-r--r-- | src/os/unix/ngx_files.c | 10 | ||||
-rw-r--r-- | src/os/unix/ngx_files.h | 9 |
2 files changed, 14 insertions, 5 deletions
diff --git a/src/os/unix/ngx_files.c b/src/os/unix/ngx_files.c index a091b9b77..7ee8cbd84 100644 --- 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 *dir) 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; } diff --git a/src/os/unix/ngx_files.h b/src/os/unix/ngx_files.h index 85dae3b97..a223b34e8 100644 --- a/src/os/unix/ngx_files.h +++ b/src/os/unix/ngx_files.h @@ -154,10 +154,11 @@ ngx_int_t ngx_open_dir(ngx_str_t *name, ngx_dir_t *dir); typedef struct { - size_t n; - glob_t pglob; - u_char *pattern; - ngx_log_t *log; + size_t n; + glob_t pglob; + u_char *pattern; + ngx_log_t *log; + ngx_uint_t test; } ngx_glob_t; |