hare

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

commit 7dd7673c6c0ab7ebe3c814007316550045c492ee
parent 750d4906a55f64736a4e438ca88fb00e8da7b2c7
Author: Sebastian <sebastian@sebsite.pw>
Date:   Wed, 31 May 2023 01:12:38 -0400

os::exec+freebsd: use unix::signal::signame

Signed-off-by: Sebastian <sebastian@sebsite.pw>

Diffstat:
Mos/exec/process+freebsd.ha | 6+++---
Mscripts/gen-stdlib | 2+-
Mstdlib.mk | 4++--
3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/os/exec/process+freebsd.ha b/os/exec/process+freebsd.ha @@ -5,6 +5,7 @@ use errors; use rt; use fmt; +use unix::signal; // Stores information about a child process. export type process = int; @@ -167,9 +168,8 @@ export fn exitstr(status: exit_status) const str = { i: int); }; case let s: signaled => - // TODO: Add signal name (once unix::signal is ported to - // FreeBSD) - return fmt::bsprintf(buf, "exited with signal {}", s: int); + return fmt::bsprintf(buf, "exited with signal {}", + signal::signame(s)); }; }; diff --git a/scripts/gen-stdlib b/scripts/gen-stdlib @@ -1202,7 +1202,7 @@ os_exec() { types.ha \ cmd.ha gen_ssa -pfreebsd os::exec os strings fmt errors unix rt io ascii \ - types::c + unix::signal types::c } path() { diff --git a/stdlib.mk b/stdlib.mk @@ -1931,7 +1931,7 @@ stdlib_os_exec_freebsd_srcs = \ $(STDLIB)/os/exec/types.ha \ $(STDLIB)/os/exec/cmd.ha -$(HARECACHE)/os/exec/os_exec-freebsd.ssa: $(stdlib_os_exec_freebsd_srcs) $(stdlib_rt) $(stdlib_os_$(PLATFORM)) $(stdlib_strings_$(PLATFORM)) $(stdlib_fmt_$(PLATFORM)) $(stdlib_errors_$(PLATFORM)) $(stdlib_unix_$(PLATFORM)) $(stdlib_rt_$(PLATFORM)) $(stdlib_io_$(PLATFORM)) $(stdlib_ascii_$(PLATFORM)) $(stdlib_types_c_$(PLATFORM)) +$(HARECACHE)/os/exec/os_exec-freebsd.ssa: $(stdlib_os_exec_freebsd_srcs) $(stdlib_rt) $(stdlib_os_$(PLATFORM)) $(stdlib_strings_$(PLATFORM)) $(stdlib_fmt_$(PLATFORM)) $(stdlib_errors_$(PLATFORM)) $(stdlib_unix_$(PLATFORM)) $(stdlib_rt_$(PLATFORM)) $(stdlib_io_$(PLATFORM)) $(stdlib_ascii_$(PLATFORM)) $(stdlib_unix_signal_$(PLATFORM)) $(stdlib_types_c_$(PLATFORM)) @printf 'HAREC \t$@\n' @mkdir -p $(HARECACHE)/os/exec @$(stdlib_env) $(HAREC) $(HAREFLAGS) -o $@ -Nos::exec \ @@ -4384,7 +4384,7 @@ testlib_os_exec_freebsd_srcs = \ $(STDLIB)/os/exec/types.ha \ $(STDLIB)/os/exec/cmd.ha -$(TESTCACHE)/os/exec/os_exec-freebsd.ssa: $(testlib_os_exec_freebsd_srcs) $(testlib_rt) $(testlib_os_$(PLATFORM)) $(testlib_strings_$(PLATFORM)) $(testlib_fmt_$(PLATFORM)) $(testlib_errors_$(PLATFORM)) $(testlib_unix_$(PLATFORM)) $(testlib_rt_$(PLATFORM)) $(testlib_io_$(PLATFORM)) $(testlib_ascii_$(PLATFORM)) $(testlib_types_c_$(PLATFORM)) +$(TESTCACHE)/os/exec/os_exec-freebsd.ssa: $(testlib_os_exec_freebsd_srcs) $(testlib_rt) $(testlib_os_$(PLATFORM)) $(testlib_strings_$(PLATFORM)) $(testlib_fmt_$(PLATFORM)) $(testlib_errors_$(PLATFORM)) $(testlib_unix_$(PLATFORM)) $(testlib_rt_$(PLATFORM)) $(testlib_io_$(PLATFORM)) $(testlib_ascii_$(PLATFORM)) $(testlib_unix_signal_$(PLATFORM)) $(testlib_types_c_$(PLATFORM)) @printf 'HAREC \t$@\n' @mkdir -p $(TESTCACHE)/os/exec @$(testlib_env) $(HAREC) $(TESTHAREFLAGS) -o $@ -Nos::exec \