Mercurial > hg > nginx-quic
diff src/core/ngx_open_file_cache.c @ 3595:8944c3e318ab stable-0.7
merge r3498, r3499:
opening files fixes:
*) use non-blocking open() not to hang on FIFO files, etc.
*) do not log misleading errno in "not a regular file" error
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 07 Jun 2010 12:08:44 +0000 |
parents | d65ba5392f59 |
children |
line wrap: on
line diff
--- a/src/core/ngx_open_file_cache.c +++ b/src/core/ngx_open_file_cache.c @@ -487,7 +487,14 @@ ngx_open_and_stat_file(u_char *name, ngx } 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,