all repos — honk @ 7dceda74059755dbcd9dea6ddba3372f5ccac2fa

my fork of honk

error check unveil
Ted Unangst tedu@tedunangst.com
Mon, 10 Jul 2023 00:15:35 -0400
commit

7dceda74059755dbcd9dea6ddba3372f5ccac2fa

parent

d142286f521764f3c8b71727582a67ad695dfa70

1 files changed, 4 insertions(+), 6 deletions(-)

jump to
M unveil.gounveil.go

@@ -29,7 +29,7 @@ "fmt"

"unsafe" ) -func Unveil(path string, perms string) error { +func Unveil(path string, perms string) { cpath := C.CString(path) defer C.free(unsafe.Pointer(cpath)) cperms := C.CString(perms)

@@ -37,20 +37,18 @@ defer C.free(unsafe.Pointer(cperms))

rv, err := C.unveil(cpath, cperms) if rv != 0 { - return fmt.Errorf("unveil(%s, %s) failure (%d)", path, perms, err) + return elog.Fatalf("unveil(%s, %s) failure (%d)", path, perms, err) } - return nil } -func Pledge(promises string) error { +func Pledge(promises string) { cpromises := C.CString(promises) defer C.free(unsafe.Pointer(cpromises)) rv, err := C.pledge(cpromises, nil) if rv != 0 { - return fmt.Errorf("pledge(%s) failure (%d)", promises, err) + elog.Fatalf("pledge(%s) failure (%d)", promises, err) } - return nil } func init() {