From a13b3b97eafbbe7fa6586e4f73b8c80ee478244c Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Tue, 29 Apr 2008 09:28:42 +0000 Subject: ignore glob no match error --- src/os/unix/ngx_files.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/os/unix/ngx_files.c') 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; } -- cgit v1.2.3