Skip to content

Commit afeeb84

Browse files
spacewanderthibaultcha
authored andcommitted
bugfix: ngx.pipe: fixed a segfault when error_log is configured with syslog.
Fix openresty/lua-resty-shell#7.
1 parent 2bc20cc commit afeeb84

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ngx_http_lua_pipe.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -703,8 +703,8 @@ ngx_http_lua_ffi_pipe_spawn(ngx_http_lua_ffi_pipe_proc_t *proc,
703703
"pipe fd");
704704
}
705705

706-
errlog_fd = ngx_cycle->log->file->fd;
707-
if (errlog_fd == STDERR_FILENO) {
706+
if (ngx_cycle->log->file && ngx_cycle->log->file->fd == STDERR_FILENO) {
707+
errlog_fd = ngx_cycle->log->file->fd;
708708
temp_errlog_fd = dup(errlog_fd);
709709

710710
if (temp_errlog_fd == -1) {

0 commit comments

Comments
 (0)