~sircmpwn/himitsu-ssh

2753e402f86ac2b092068200db1d2b7cf33b05d4 — Armin Preiml 1 year, 3 months ago 1ba87c3
updates following the stdlib changes
2 files changed, 6 insertions(+), 6 deletions(-)

M cmd/hissh-agent/main.ha
M cmd/hissh-import/main.ha
M cmd/hissh-agent/main.ha => cmd/hissh-agent/main.ha +5 -5
@@ 24,7 24,7 @@ let running: bool = true;
export fn main() void = {
	// TODO: Parse options (foreground/background, socket path)
	// TODO: Fork to background
	const path = path::init();
	const path = path::init()!;
	path::set(&path, dirs::runtime()!, "hissh-agent")!;

	const sockpath = path::string(&path);


@@ 41,8 41,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(signal::sig::INT, &handle_signal);
	signal::handle(signal::sig::TERM, &handle_signal);

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


@@ 59,7 59,7 @@ export fn main() void = {
	log::println("Terminated.");
};

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



@@ 335,7 335,7 @@ fn handle_sign_request(
};

fn himitsu_connect() (net::socket | net::error) = {
	let path = path::init();
	let path = path::init()!;
	const sockpath = path::set(&path, dirs::runtime()!, "himitsu")!;
	return unix::connect(sockpath);
};

M cmd/hissh-import/main.ha => cmd/hissh-import/main.ha +1 -1
@@ 52,7 52,7 @@ export fn main() void = {

	// TODO: It would be nice if himitsu (library) provided some tools for
	// connecting to and interacting with a Himitsu socket
	let path = path::init();
	let path = path::init()!;
	const sockpath = path::set(&path, dirs::runtime()!, "himitsu")!;
	let conn = match (unix::connect(sockpath)) {
	case let s: net::socket =>