hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 3d8b47635db832b9e62a86fd492a1640823f9438
parent 4e174926076493054324e5f46685b27fbafa9ed3
Author: Autumn! <autumnull@posteo.net>
Date:   Fri,  8 Sep 2023 14:37:18 +0000

os: remove workaround for cwd initialization

Signed-off-by: Autumn! <autumnull@posteo.net>

Diffstat:
Mos/+freebsd/fs.ha | 11++---------
Mos/+linux/fs.ha | 11++---------
2 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/os/+freebsd/fs.ha b/os/+freebsd/fs.ha @@ -7,16 +7,9 @@ use path; use rt; use types::c; -export fn init_cwd() void = { - // XXX: Workaround for https://todo.sr.ht/~sircmpwn/hare/616 +@init fn init_cwd() void = { static let cwd_fs = os_filesystem { ... }; - if (cwd_fs.dirfd == 0) { - cwd = static_dirfdopen(rt::AT_FDCWD, &cwd_fs); - }; -}; - -@init fn init() void = { - init_cwd(); + cwd = static_dirfdopen(rt::AT_FDCWD, &cwd_fs); }; // Returns the current working directory. The return value is statically diff --git a/os/+linux/fs.ha b/os/+linux/fs.ha @@ -7,16 +7,9 @@ use path; use rt; use types::c; -export fn init_cwd() void = { - // XXX: Workaround for https://todo.sr.ht/~sircmpwn/hare/616 +@init fn init_cwd() void = { static let cwd_fs = os_filesystem { ... }; - if (cwd_fs.dirfd == 0) { - cwd = static_dirfdopen(rt::AT_FDCWD, &cwd_fs); - }; -}; - -@init fn init() void = { - init_cwd(); + cwd = static_dirfdopen(rt::AT_FDCWD, &cwd_fs); }; // Returns the current working directory. The return value is statically