~stacyharper/bonsai

a89d145469ff6a0b01c95c891acdf4f95d66c36c — Stacy Harper 2 months ago 14542c6
Re-assign the newly created fd

I dunno how this was working before…
1 files changed, 5 insertions(+), 1 deletions(-)

M cmd/bonsaid/socket.ha
M cmd/bonsaid/socket.ha => cmd/bonsaid/socket.ha +5 -1
@@ 122,10 122,14 @@ fn dispatch(serv: *server) bool = {
				bonsai::trigger_delay_transition(&serv.state);
			};

			let wait_pipes = serv.state.wait_pipes as (io::file, io::file);
			const wait_pipes = serv.state.wait_pipes as (io::file, io::file);
			io::close(wait_pipes.0)!;
			io::close(wait_pipes.1)!;

			serv.state.wait_pipes = unix::pipe(unix::pipe_flag::NONBLOCK)!;
			const wait_pipes = serv.state.wait_pipes as (io::file, io::file);

			serv.pollfd[2].fd = wait_pipes.0;
		};
		for (let i = POLLFD_RESERVED; i < len(serv.pollfd); i += 1) {
			dispatch_client(serv, &serv.clients[i - POLLFD_RESERVED]);