~sircmpwn/himitsu-devel

himitsu: Fix compilation with new stdlib v1 APPLIED

Alexey Yerin: 1
 Fix compilation with new stdlib

 8 files changed, 15 insertions(+), 15 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/himitsu-devel/patches/41427/mbox | git am -3
Learn more about email & git

[PATCH himitsu] Fix compilation with new stdlib Export this patch

path::init() -> path::init()!
path::add -> path::push
---
 cmd/himitsu-init/main.ha | 4 ++--
 cmd/himitsud/socket.ha   | 4 ++--
 cmd/hiq/main.ha          | 2 +-
 config/conf.ha           | 2 +-
 himitsu/client/client.ha | 2 +-
 secstore/delete.ha       | 6 +++---
 secstore/secstore.ha     | 8 ++++----
 secstore/serialize.ha    | 2 +-
 8 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/cmd/himitsu-init/main.ha b/cmd/himitsu-init/main.ha
index 02566b4..334ff69 100644
--- a/cmd/himitsu-init/main.ha
+++ b/cmd/himitsu-init/main.ha
@@ -122,7 +122,7 @@ export fn main() void = {
};

fn writeconf() void = {
	let buf = path::init();
	let buf = path::init()!;
	const confdir = dirs::config("himitsu");
	match (os::mkdirs(confdir, 0o755)) {
	case let err: fs::error =>
@@ -196,7 +196,7 @@ fn reencrypt(tty: io::handle) void = {

// check whether himitsud is running
fn checkhimitsud() bool = {
	let buf = path::init();
	let buf = path::init()!;
	let rtdir = match (dirs::runtime()) {
	case let e: fs::error =>
		fmt::fatal("error getting runtime dir: ", fs::strerror(e));
diff --git a/cmd/himitsud/socket.ha b/cmd/himitsud/socket.ha
index 0ae701f..5f09243 100644
--- a/cmd/himitsud/socket.ha
+++ b/cmd/himitsud/socket.ha
@@ -47,7 +47,7 @@ fn bind(
		yield dir;
	};

	let buf = path::init();
	let buf = path::init()!;
	path::set(&buf, statedir, "himitsu")!;
	const sockpath = path::string(&buf);

@@ -102,7 +102,7 @@ fn shutdown(serv: *server) void = {
	free(serv.clients);
	free(serv.pollfd);

	let buf = path::init();
	let buf = path::init()!;
	path::set(&buf, dirs::runtime()!, "himitsu")!;
	os::remove(path::string(&buf))!;

diff --git a/cmd/hiq/main.ha b/cmd/hiq/main.ha
index ad0460e..57e8f6d 100644
--- a/cmd/hiq/main.ha
+++ b/cmd/hiq/main.ha
@@ -74,7 +74,7 @@ export fn main() void = {
		};
	};

	let buf = path::init();
	let buf = path::init()!;
	// TODO: Bubble up dirs::runtime errors
	const sockpath = path::set(&buf, dirs::runtime()!, "himitsu")!;
	let conn = match (unix::connect(sockpath)) {
diff --git a/config/conf.ha b/config/conf.ha
index 856cb46..2fdf749 100644
--- a/config/conf.ha
+++ b/config/conf.ha
@@ -31,7 +31,7 @@ export fn strerror(err: error) const str = {
// Loads the Himitsu configuration file. Pass the return value to [[finish]] to
// free associated resources.
export fn load() (config | error) = {
	let buf = path::init();
	let buf = path::init()!;
	path::set(&buf, dirs::config("himitsu"), "config.ini")!;

	const file = os::open(path::string(&buf))?;
diff --git a/himitsu/client/client.ha b/himitsu/client/client.ha
index b4c4f8b..12fbe4a 100644
--- a/himitsu/client/client.ha
+++ b/himitsu/client/client.ha
@@ -47,7 +47,7 @@ export fn strerror(err: error) const str = {

// Connects to the Himitsu socket, returning the connection's file descriptor.
export fn connect() (net::socket | error) = {
	let buf = path::init();
	let buf = path::init()!;
	// TODO: Bubble up dirs::runtime errors
	const sockpath = path::set(&buf, dirs::runtime()!, "himitsu")!;
	return unix::connect(sockpath)?;
diff --git a/secstore/delete.ha b/secstore/delete.ha
index 4a664b6..1097d9d 100644
--- a/secstore/delete.ha
+++ b/secstore/delete.ha
@@ -26,11 +26,11 @@ export fn del(store: *secstore, q: *query::query) (void | locked) = {

	io::close(store.index)!;

	let buf = path::init();
	let buf = path::init()!;
	path::set(&buf, store.dir, "index")!;
	const oldpath = strings::dup(path::string(&buf));
	defer free(oldpath);
	path::add(&buf, "..", "index.1")!;
	path::push(&buf, "..", "index.1")!;

	const index = os::create(path::string(&buf), 0o600)!;
	for (let i = 0z; i < len(store.entries); i += 1) {
@@ -42,7 +42,7 @@ export fn del(store: *secstore, q: *query::query) (void | locked) = {
};

fn delkeys(store: *secstore, entry: *entry) void = {
	let buf = path::init();
	let buf = path::init()!;

	for (let i = 0z; i < len(entry.pairs); i += 1) {
		const pair = &entry.pairs[i];
diff --git a/secstore/secstore.ha b/secstore/secstore.ha
index f02bf11..fad9a43 100644
--- a/secstore/secstore.ha
+++ b/secstore/secstore.ha
@@ -61,7 +61,7 @@ fn createat(passphrase: []u8, dir: const str) (secstore | error) = {

	const verify = key[32..];

	let buf = path::init();
	let buf = path::init()!;
	path::set(&buf, dir, "key")!;
	const keyfile = os::create(path::string(&buf), 0o600)?;
	defer io::close(keyfile)!;
@@ -211,7 +211,7 @@ export fn open() (secstore | error) = {
};

fn openat(dir: str) (secstore | error) = {
	let buf = path::init();
	let buf = path::init()!;
	path::set(&buf, dir, "index")!;

	const index = os::open(path::string(&buf), fs::flags::RDWR)?;
@@ -226,7 +226,7 @@ fn openat(dir: str) (secstore | error) = {

// Unlocks the keystore using the given passphrase.
export fn unlock(store: *secstore, passphrase: []u8) (void | error) = {
	let buf = path::init();
	let buf = path::init()!;
	path::set(&buf, store.dir, "key")!;

	const input = os::open(path::string(&buf))?;
@@ -423,7 +423,7 @@ fn add_secret(store: *secstore, val: str) uuid::uuid = {
	const id = uuid::generate();
	const idstr = uuid::encodestr(id);

	let buf = path::init();
	let buf = path::init()!;
	path::set(&buf, store.dir, idstr)!;

	const file = os::create(path::string(&buf), 0o600)!;
diff --git a/secstore/serialize.ha b/secstore/serialize.ha
index dd325b1..99e6fa7 100644
--- a/secstore/serialize.ha
+++ b/secstore/serialize.ha
@@ -60,7 +60,7 @@ fn write_private(

	const idstr = uuid::encodestr(id);

	let buf = path::init();
	let buf = path::init()!;
	path::set(&buf, store.dir, idstr)!;

	const file = os::open(path::string(&buf))?;
-- 
2.40.1
Applied to master. Thanks!