diff options
author | Max Romanov <max.romanov@nginx.com> | 2020-08-11 21:48:16 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2020-08-11 21:48:16 +0300 |
commit | acb0cca49def92563d9b221d818b541b60e30eaa (patch) | |
tree | 602022eab972be03bc2f42797f7f9f95f9be55c9 /src/nxt_application.c | |
parent | 8cf522bf2d8c2d3bcef88ab86c93e06c6afcb6ae (diff) | |
download | unit-acb0cca49def92563d9b221d818b541b60e30eaa.tar.gz unit-acb0cca49def92563d9b221d818b541b60e30eaa.tar.bz2 |
Moving file descriptor blocking to libunit.
The default libunit behavior relies on blocking the recv() call for port file
descriptors, which an application may override if needed. For external
applications, port file descriptors were toggled to blocking mode before the
exec() call. If the exec() call failed, descriptor remained blocked, so the
process hanged while trying to read from it.
This patch moves file descriptor mode switch inside libunit.
Diffstat (limited to '')
-rw-r--r-- | src/nxt_application.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/src/nxt_application.c b/src/nxt_application.c index 372a88b4..57e4615e 100644 --- a/src/nxt_application.c +++ b/src/nxt_application.c @@ -1290,8 +1290,6 @@ nxt_unit_default_init(nxt_task_t *task, nxt_unit_init_t *init) init->ready_port.in_fd = -1; init->ready_port.out_fd = main_port->pair[1]; - nxt_fd_blocking(task, main_port->pair[1]); - init->ready_stream = my_port->process->stream; init->router_port.id.pid = router_port->pid; @@ -1299,15 +1297,11 @@ nxt_unit_default_init(nxt_task_t *task, nxt_unit_init_t *init) init->router_port.in_fd = -1; init->router_port.out_fd = router_port->pair[1]; - nxt_fd_blocking(task, router_port->pair[1]); - init->read_port.id.pid = my_port->pid; init->read_port.id.id = my_port->id; init->read_port.in_fd = my_port->pair[0]; init->read_port.out_fd = -1; - nxt_fd_blocking(task, my_port->pair[0]); - init->log_fd = 2; return NXT_OK; |