line wrapping

This commit is contained in:
Josh Rickmar
2023-10-24 13:36:05 +00:00
parent b6542da286
commit ab98739231
2 changed files with 10 additions and 5 deletions

View File

@@ -35,7 +35,8 @@ func Pledge(promises, execpromises string) error {
return err
}
_, _, e := syscall.Syscall(SYS_PLEDGE, uintptr(unsafe.Pointer(pptr)), uintptr(unsafe.Pointer(exptr)), 0)
_, _, e := syscall.Syscall(SYS_PLEDGE, uintptr(unsafe.Pointer(pptr)),
uintptr(unsafe.Pointer(exptr)), 0)
if e != 0 {
return e
}
@@ -62,7 +63,8 @@ func PledgePromises(promises string) error {
return err
}
_, _, e := syscall.Syscall(SYS_PLEDGE, uintptr(unsafe.Pointer(pptr)), uintptr(expr), 0)
_, _, e := syscall.Syscall(SYS_PLEDGE, uintptr(unsafe.Pointer(pptr)),
uintptr(expr), 0)
if e != 0 {
return e
}
@@ -89,7 +91,8 @@ func PledgeExecpromises(execpromises string) error {
return err
}
_, _, e := syscall.Syscall(SYS_PLEDGE, uintptr(pptr), uintptr(unsafe.Pointer(exptr)), 0)
_, _, e := syscall.Syscall(SYS_PLEDGE, uintptr(pptr),
uintptr(unsafe.Pointer(exptr)), 0)
if e != 0 {
return e
}
@@ -130,7 +133,8 @@ func pledgeAvailable() error {
// Require OpenBSD 6.4 as a minimum.
if maj < 6 || (maj == 6 && min <= 3) {
return fmt.Errorf("cannot call Pledge on OpenBSD %d.%d", maj, min)
return fmt.Errorf("cannot call Pledge on OpenBSD %d.%d", maj,
min)
}
return nil

View File

@@ -60,7 +60,8 @@ func supportsUnveil() error {
// unveil is not available before 6.4
if maj < 6 || (maj == 6 && min <= 3) {
return fmt.Errorf("cannot call Unveil on OpenBSD %d.%d", maj, min)
return fmt.Errorf("cannot call Unveil on OpenBSD %d.%d", maj,
min)
}
return nil