172a173
> nxt_inline int nxt_unit_close(int fd);
493,494c494,495
< close(ready_port.out_fd);
< close(queue_fd);
---
> nxt_unit_close(ready_port.out_fd);
> nxt_unit_close(queue_fd);
501c502
< close(queue_fd);
---
> nxt_unit_close(queue_fd);
1041c1042
< close(recv_msg.fd);
---
> nxt_unit_close(recv_msg.fd);
1045c1046
< close(recv_msg.fd2);
---
> nxt_unit_close(recv_msg.fd2);
1674c1675
< close(req->content_fd);
---
> nxt_unit_close(req->content_fd);
2914c2915
< close(req->content_fd);
---
> nxt_unit_close(req->content_fd);
3026c3027
< close(req->content_fd);
---
> nxt_unit_close(req->content_fd);
3584c3585
< close(fd);
---
> nxt_unit_close(fd);
3621c3622
< close(fd);
---
> nxt_unit_close(fd);
3702c3703
< close(fd);
---
> nxt_unit_close(fd);
4913c4914
< close(queue_fd);
---
> nxt_unit_close(queue_fd);
4920c4921
< close(queue_fd);
---
> nxt_unit_close(queue_fd);
5037,5038c5038,5039
< close(port_sockets[0]);
< close(port_sockets[1]);
---
> nxt_unit_close(port_sockets[0]);
> nxt_unit_close(port_sockets[1]);
5055,5056c5056,5057
< close(port_sockets[0]);
< close(port_sockets[1]);
---
> nxt_unit_close(port_sockets[0]);
> nxt_unit_close(port_sockets[1]);
5142,5143c5143,5145
< nxt_unit_debug(NULL, "destroy port{%d,%d}",
< (int) port->id.pid, (int) port->id.id);
---
> nxt_unit_debug(NULL, "destroy port{%d,%d} in_fd %d out_fd %d",
> (int) port->id.pid, (int) port->id.id,
> port->in_fd, port->out_fd);
5148c5150
< close(port->in_fd);
---
> nxt_unit_close(port->in_fd);
5154c5156
< close(port->out_fd);
---
> nxt_unit_close(port->out_fd);
5159,5170d5160
< if (port->in_fd != -1) {
< close(port->in_fd);
<
< port->in_fd = -1;
< }
<
< if (port->out_fd != -1) {
< close(port->out_fd);
<
< port->out_fd = -1;
< }
<
5217c5207
< close(port->in_fd);
---
> nxt_unit_close(port->in_fd);
5227c5217
< close(port->out_fd);
---
> nxt_unit_close(port->out_fd);
5912a5903,5921
> nxt_inline int
> nxt_unit_close(int fd)
> {
> int res;
>
> res = close(fd);
>
> if (nxt_slow_path(res == -1)) {
> nxt_unit_alert(NULL, "close(%d) failed: %s (%d)",
> fd, strerror(errno), errno);
>
> } else {
> nxt_unit_debug(NULL, "close(%d): %d", fd, res);
> }
>
> return res;
> }
>
>