bunpen: lift main up to the toplevel

it seems modules *do* support freestanding hare files at the toplevel -- but only if theres just one of them (?)
This commit is contained in:
2024-08-23 08:22:40 +00:00
parent daa1783e21
commit 5525ea4b59
3 changed files with 4 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
all: bunpen all: bunpen
bunpen: bunpen:
hare build -o $@ main/ hare build -o $@
install: install:
mkdir -p $(PREFIX)/bin mkdir -p $(PREFIX)/bin

View File

@@ -1,5 +1,6 @@
// vim: set shiftwidth=2 : // vim: set shiftwidth=2 :
use log; use log;
use methods;
use rtext; use rtext;
use strings; use strings;
use os; use os;
@@ -18,6 +19,6 @@ export fn main() void = {
let my_name = os::args[0]; let my_name = os::args[0];
let exec_line = os::args[1..]; let exec_line = os::args[1..];
rtext::no_new_privs(); rtext::no_new_privs();
landlock_restrict(); methods::landlock_restrict();
do_exec(exec_line); do_exec(exec_line);
}; };

View File

@@ -27,7 +27,7 @@ fn access_fs_roughly_write() u64 = return
fn access_fs_roughly_rw() u64 = return access_fs_roughly_read() | access_fs_roughly_write(); fn access_fs_roughly_rw() u64 = return access_fs_roughly_read() | access_fs_roughly_write();
fn landlock_restrict() void = { export fn landlock_restrict() void = {
let abi = rtext::landlock_create_ruleset(null, rtext::LANDLOCK_CREATE_RULESET_VERSION)!; let abi = rtext::landlock_create_ruleset(null, rtext::LANDLOCK_CREATE_RULESET_VERSION)!;
log::printfln("found landlock version {}", abi); log::printfln("found landlock version {}", abi);