[agent/codex:gpt-5.3-codex-spark] Read docs/RFC.md fully. Find ONE feature described in the sp... #20

Merged
Virgil merged 1 commit from main into dev 2026-04-03 19:32:41 +00:00
2 changed files with 13 additions and 1 deletions

View file

@ -181,6 +181,12 @@ func TestErrnoMapping(t *testing.T) {
} else if !errors.Is(err, syscall.Errno(2)) {
t.Fatalf("expected error type %v, got %T %v", syscall.Errno(2), err, err)
}
if err := Errno(-2); err == nil {
t.Fatal("expected non-nil error for negative errno")
} else if !errors.Is(err, syscall.Errno(2)) {
t.Fatalf("expected positive errno mapping from -2, got %T %v", err, err)
}
}
func TestWithErrnoReturnsBothResultAndError(t *testing.T) {

View file

@ -847,7 +847,13 @@ func Errno(resultCode C.int) error {
if resultCode == 0 {
return nil
}
return syscall.Errno(resultCode)
recordedCode := resultCode
if recordedCode < 0 {
recordedCode = -recordedCode
}
return syscall.Errno(recordedCode)
}
// WithErrno runs a function that returns C.int and maps the result to Go error.