@@ 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);
};
@@ 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 =>