~sircmpwn/hare-ssh

9da93c2bac4ee754dd9866b628a00e35e8e9a0dc — Armin Preiml 6 months ago 9b75ebb
update to os::signal changes
1 files changed, 4 insertions(+), 3 deletions(-)

M cmd/ssh-agent/main.ha
M cmd/ssh-agent/main.ha => cmd/ssh-agent/main.ha +4 -3
@@ 12,6 12,7 @@ use os;
use path;
use strings;
use unix::signal;
use unix::signal::{sig};

let running: bool = true;



@@ 38,8 39,8 @@ export fn main() void = {
	os::chmod(sockpath, 0o700)!;
	log::printfln("Listening at {}", sockpath);

	signal::handle(signal::SIGINT, &handle_signal);
	signal::handle(signal::SIGTERM, &handle_signal);
	signal::handle(sig::INT, &handle_signal);
	signal::handle(sig::TERM, &handle_signal);

	for (running) {
		const client = match (net::accept(listener)) {


@@ 165,6 166,6 @@ fn handle_sign_request(
	log::printfln("Signed challenge with key {}", key.comment);
};

fn handle_signal(sig: int, info: *signal::siginfo, ucontext: *void) void = {
fn handle_signal(sig: sig, info: *signal::siginfo, ucontext: *void) void = {
	running = false;
};