diff options
author | Igor Sysoev <igor@sysoev.ru> | 2010-04-21 15:59:36 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2010-04-21 15:59:36 +0000 |
commit | bfc8b78f5736eafe48432bb0d2f819b6a968b17a (patch) | |
tree | 03b939c788c73fc9847a2c95547f408bcbb0d9de /src/core/ngx_open_file_cache.c | |
parent | 9c1a43e050c4824304e84c1e9ec47f54ac1ac8b6 (diff) | |
download | nginx-bfc8b78f5736eafe48432bb0d2f819b6a968b17a.tar.gz nginx-bfc8b78f5736eafe48432bb0d2f819b6a968b17a.zip |
use non-blocking open() not to hang on FIFO files, etc.
Diffstat (limited to 'src/core/ngx_open_file_cache.c')
-rw-r--r-- | src/core/ngx_open_file_cache.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/core/ngx_open_file_cache.c b/src/core/ngx_open_file_cache.c index 6aa66fd4e..a9c45324d 100644 --- a/src/core/ngx_open_file_cache.c +++ b/src/core/ngx_open_file_cache.c @@ -490,7 +490,14 @@ ngx_open_and_stat_file(u_char *name, ngx_open_file_info_t *of, ngx_log_t *log) } if (!of->log) { - fd = ngx_open_file(name, NGX_FILE_RDONLY, NGX_FILE_OPEN, 0); + + /* + * Use non-blocking open() not to hang on FIFO files, etc. + * This flag has no effect on a regular files. + */ + + fd = ngx_open_file(name, NGX_FILE_RDONLY|NGX_FILE_NONBLOCK, + NGX_FILE_OPEN, 0); } else { fd = ngx_open_file(name, NGX_FILE_APPEND, NGX_FILE_CREATE_OR_OPEN, |