lib/errors: errnotest use os.exit not raw syscall (rule-7)
The local doexit reimplemented os.exit via a raw rt_syscall(60) decl with no documented divergence, while the file already imports + uses os. os.exit (lib/os/os.ww:68) is byte-identical (syscall1(nr.EXIT=60)); ostest/stattest siblings already use os.exit.
This commit is contained in:
@@ -11,15 +11,10 @@ package errors;
|
||||
import errors;
|
||||
import os;
|
||||
|
||||
@symbol("rt_syscall") fn syscall1ww(num: i64, a: i64) i64;
|
||||
fn doexit(code: i32) void = {
|
||||
syscall1ww(60i64, code: i64);
|
||||
};
|
||||
|
||||
// signalled — bumped by main before each test so a failing exit code
|
||||
// pinpoints the offending case.
|
||||
let signalled: i32 = 0;
|
||||
fn fail() void = { doexit(signalled + 10); };
|
||||
fn fail() void = { os.exit(signalled + 10); };
|
||||
|
||||
fn streq(a: str, b: str) bool = {
|
||||
if (a.len != b.len) { return false; };
|
||||
|
||||
Reference in New Issue
Block a user