Klaus Demo nginx / bfc8b78
use non-blocking open() not to hang on FIFO files, etc. Igor Sysoev 12 years ago
3 changed file(s) with 10 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
489489 }
490490
491491 if (!of->log) {
492 fd = ngx_open_file(name, NGX_FILE_RDONLY, NGX_FILE_OPEN, 0);
492
493 /*
494 * Use non-blocking open() not to hang on FIFO files, etc.
495 * This flag has no effect on a regular files.
496 */
497
498 fd = ngx_open_file(name, NGX_FILE_RDONLY|NGX_FILE_NONBLOCK,
499 NGX_FILE_OPEN, 0);
493500
494501 } else {
495502 fd = ngx_open_file(name, NGX_FILE_APPEND, NGX_FILE_CREATE_OR_OPEN,
6363 #define NGX_FILE_OPEN 0
6464 #define NGX_FILE_TRUNCATE O_CREAT|O_TRUNC
6565 #define NGX_FILE_APPEND O_WRONLY|O_APPEND
66 #define NGX_FILE_NONBLOCK O_NONBLOCK
6667
6768 #define NGX_FILE_DEFAULT_ACCESS 0644
6869 #define NGX_FILE_OWNER_ACCESS 0600
6363 #define NGX_FILE_WRONLY GENERIC_WRITE
6464 #define NGX_FILE_RDWR GENERIC_READ|GENERIC_WRITE
6565 #define NGX_FILE_APPEND FILE_APPEND_DATA|SYNCHRONIZE
66 #define NGX_FILE_NONBLOCK 0
6667
6768 #define NGX_FILE_CREATE_OR_OPEN OPEN_ALWAYS
6869 #define NGX_FILE_OPEN OPEN_EXISTING